modify string_to_cp437 input type
@@ -276,9 +276,8 @@ pub fn to_cp437(c: char) -> u8 {
}
/// Converts a string into a vector of u8, CP437 representations of the string
-pub fn string_to_cp437<S: ToString>(input: S) -> Vec<u8> {
- let s = input.to_string();
- s.chars().map(|c| to_cp437(c)).collect()
+pub fn string_to_cp437<S: AsRef<str>>(input: S) -> Vec<u8> {
+ input.as_ref().chars().map(|c| to_cp437(c)).collect()
}
#[cfg(test)]
