diff --git a/xous-rs/src/string.rs b/xous-rs/src/string.rs index 7be38f6f9..7e2129ff3 100644 --- a/xous-rs/src/string.rs +++ b/xous-rs/src/string.rs @@ -20,7 +20,8 @@ impl String { } } - pub fn from_str(src: &str) -> String { + pub fn from_str(src: T) -> String where T: AsRef { + let src = src.as_ref(); let mut s = Self::new(); // Copy the string into our backing store. for (&src_byte, dest_byte) in src.as_bytes().iter().zip(&mut s.bytes) {