Fix clippy lints

This commit is contained in:
Héctor Ramón Jiménez 2023-09-18 19:08:57 +02:00
parent e7326f0af6
commit 161a971d06
No known key found for this signature in database
GPG key ID: 7CC46565708259A7

View file

@ -118,7 +118,7 @@ impl Application for Editor {
String::new(), String::new(),
|mut contents, (i, line)| { |mut contents, (i, line)| {
if i > 0 { if i > 0 {
contents.push_str("\n"); contents.push('\n');
} }
contents.push_str(&line); contents.push_str(&line);
@ -127,8 +127,8 @@ impl Application for Editor {
}, },
); );
if !contents.ends_with("\n") { if !contents.ends_with('\n') {
contents.push_str("\n"); contents.push('\n');
} }
Command::perform( Command::perform(
@ -266,7 +266,7 @@ async fn save_file(
.ok_or(Error::DialogClosed)? .ok_or(Error::DialogClosed)?
}; };
let _ = tokio::fs::write(&path, contents) tokio::fs::write(&path, contents)
.await .await
.map_err(|error| Error::IoError(error.kind()))?; .map_err(|error| Error::IoError(error.kind()))?;