Skip to content

Commit

Permalink
style: simplify some statements for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
hamirmahal authored and complexspaces committed Dec 26, 2024
1 parent 782b98c commit e458e1a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/hello_world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ fn main() {

let the_string = "Hello, world!";
clipboard.set_text(the_string).unwrap();
println!("But now the clipboard text should be: \"{}\"", the_string);
println!("But now the clipboard text should be: \"{the_string}\"");
}
2 changes: 1 addition & 1 deletion src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl std::fmt::Debug for Error {
ConversionFailure,
Unknown { .. }
);
f.write_fmt(format_args!("{} - \"{}\"", name, self))
f.write_fmt(format_args!("{name} - \"{self}\""))
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ mod tests {
match ctx.get_text() {
Ok(text) => assert!(text.is_empty()),
Err(Error::ContentNotAvailable) => {}
Err(e) => panic!("unexpected error: {}", e),
Err(e) => panic!("unexpected error: {e}"),
};

// confirm it is OK to clear when already empty.
Expand All @@ -310,7 +310,7 @@ mod tests {
match ctx.get_text() {
Ok(text) => assert!(text.is_empty()),
Err(Error::ContentNotAvailable) => {}
Err(e) => panic!("unexpected error: {}", e),
Err(e) => panic!("unexpected error: {e}"),
};
}
{
Expand Down

0 comments on commit e458e1a

Please sign in to comment.