diff --git a/examples/parse_command.rs b/examples/parse_command.rs index 91e7e77..ed389d1 100644 --- a/examples/parse_command.rs +++ b/examples/parse_command.rs @@ -37,7 +37,7 @@ fn main() -> std::io::Result<()> { let mut line = String::new(); std::io::stdin().read_line(&mut line)?; - line.replace("\n", "\r\n") + line.replace('\n', "\r\n") }; if line.trim() == "exit" { diff --git a/src/utils.rs b/src/utils.rs index 23cf475..0abe161 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -4,11 +4,11 @@ pub(crate) fn escape_quoted(unescaped: &str) -> Cow { let mut escaped = Cow::Borrowed(unescaped); if escaped.contains('\\') { - escaped = Cow::Owned(escaped.replace("\\", "\\\\")); + escaped = Cow::Owned(escaped.replace('\\', "\\\\")); } if escaped.contains('\"') { - escaped = Cow::Owned(escaped.replace("\"", "\\\"")); + escaped = Cow::Owned(escaped.replace('\"', "\\\"")); } escaped