Skip to content

Commit 2187c4b

Browse files
committed
Allow constructing Key and Value from static str
Signed-off-by: Clément Renault <[email protected]>
1 parent 08a8192 commit 2187c4b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,8 @@ impl From<String> for Key {
220220
}
221221
}
222222

223-
impl From<&str> for Key {
224-
fn from(v: &str) -> Key {
223+
impl From<&'static str> for Key {
224+
fn from(v: &'static str) -> Key {
225225
Key(v.as_bytes().to_vec())
226226
}
227227
}
@@ -334,8 +334,8 @@ impl From<String> for Value {
334334
}
335335
}
336336

337-
impl From<&str> for Value {
338-
fn from(v: &str) -> Value {
337+
impl From<&'static str> for Value {
338+
fn from(v: &'static str) -> Value {
339339
Value(v.as_bytes().to_vec())
340340
}
341341
}

0 commit comments

Comments
 (0)