aboutsummaryrefslogtreecommitdiff
path: root/src/attribute.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2023-05-14 16:58:44 +0200
committerHampusM <hampus@hampusmat.com>2023-05-14 16:58:44 +0200
commit1621882905b6bfd911e0b0ac8be5c369f2707b31 (patch)
tree87982771e80b0489266a209653eb182fcafda88a /src/attribute.rs
parent4d6664fb369607d42c269a8a50f26bfd3c3b8634 (diff)
fix: allow a unsized key in the Attribute new function
Diffstat (limited to 'src/attribute.rs')
-rw-r--r--src/attribute.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/attribute.rs b/src/attribute.rs
index 3d17fe9..f250f67 100644
--- a/src/attribute.rs
+++ b/src/attribute.rs
@@ -23,7 +23,10 @@ pub struct Attribute<'data>
impl<'data> Attribute<'data>
{
/// Returns a new `Attribute`.
- pub fn new(key: &'data impl AsRef<[u8]>, value: impl Into<Cow<'data, [u8]>>) -> Self
+ pub fn new(
+ key: &'data (impl AsRef<[u8]> + ?Sized),
+ value: impl Into<Cow<'data, [u8]>>,
+ ) -> Self
{
Self {
inner: QuickXMLAttribute {