]> git.lizzy.rs Git - rust.git/blobdiff - src/filemap.rs
Cargo clippy
[rust.git] / src / filemap.rs
index 68e06f5c9acbfda7f0d639b35b366c9195cfe195..c7fa5e2f1efddcbbbffa125205cedd11e6b00ab5 100644 (file)
@@ -45,7 +45,7 @@ pub fn write_all_files<T>(
 }
 
 // Prints all newlines either as `\n` or as `\r\n`.
-pub fn write_system_newlines<T>(writer: T, text: &String, config: &Config) -> Result<(), io::Error>
+pub fn write_system_newlines<T>(writer: T, text: &str, config: &Config) -> Result<(), io::Error>
 where
     T: Write,
 {
@@ -79,7 +79,7 @@ pub fn write_system_newlines<T>(writer: T, text: &String, config: &Config) -> Re
 }
 
 pub fn write_file<T>(
-    text: &String,
+    text: &str,
     filename: &str,
     out: &mut T,
     config: &Config,
@@ -88,7 +88,7 @@ pub fn write_file<T>(
     T: Write,
 {
     fn source_and_formatted_text(
-        text: &String,
+        text: &str,
         filename: &str,
         config: &Config,
     ) -> Result<(String, String), io::Error> {
@@ -103,7 +103,7 @@ fn source_and_formatted_text(
 
     fn create_diff(
         filename: &str,
-        text: &String,
+        text: &str,
         config: &Config,
     ) -> Result<Vec<Mismatch>, io::Error> {
         let (ori, fmt) = source_and_formatted_text(text, filename, config)?;