Skip to content

Commit

Permalink
chore: fix future clippy lint needless_borrow
Browse files Browse the repository at this point in the history
`String` implements `IntoGStr`. So the dereference is not necessary
here.

```
warning: the borrowed expression implements the required traits
  --> src/shell_dlg.rs:77:9
   |
77 |         &format!("Save changes to '{changed_files}'?"),
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("Save changes to '{changed_files}'?")`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
   = note: `#[warn(clippy::needless_borrow)]` on by default

warning: `nvim-gtk` (bin "nvim-gtk") generated 1 warning (run `cargo clippy --fix --bin "nvim-gtk"` to apply 1 suggestion)
```
  • Loading branch information
theHamsta authored and Lyude committed Feb 19, 2023
1 parent 113fae1 commit 99b0775
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/shell_dlg.rs
Expand Up @@ -74,7 +74,7 @@ async fn show_not_saved_dlg(
flags,
MessageType::Question,
ButtonsType::None,
&format!("Save changes to '{changed_files}'?"),
format!("Save changes to '{changed_files}'?"),

This comment has been minimized.

Copy link
@sdroege

sdroege Feb 20, 2023

Doesn't really change anything in this case but you could also use glib::gformat!() here.

Or to be clear, it doesn't change anything here once gtk-rs/gtk-rs-core#1016 is merged.

);

dlg.add_buttons(&[
Expand Down

0 comments on commit 99b0775

Please sign in to comment.