Skip to content

Commit

Permalink
fix some new clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
fdncred committed May 16, 2024
1 parent 1708667 commit 24181c9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"
license = "MIT"
name = "reedline"
repository = "https://github.com/nushell/reedline"
rust-version = "1.62.1"
rust-version = "1.63.0"
version = "0.32.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
4 changes: 3 additions & 1 deletion src/core_editor/clip_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ pub trait Clipboard: Send {

fn get(&mut self) -> (String, ClipboardMode);

#[allow(dead_code)]
fn clear(&mut self) {
self.set("", ClipboardMode::Normal);
}

#[allow(dead_code)]
fn len(&mut self) -> usize {
self.get().0.len()
}
Expand Down Expand Up @@ -41,7 +43,7 @@ impl LocalClipboard {

impl Clipboard for LocalClipboard {
fn set(&mut self, content: &str, mode: ClipboardMode) {
self.content = content.to_owned();
content.clone_into(&mut self.content);
self.mode = mode;
}

Expand Down
2 changes: 1 addition & 1 deletion src/menu/description_menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ impl Menu for DescriptionMenu {
.examples
.get(example_index)
.expect("the example index is always checked");
suggestion.value = example.clone();
suggestion.value.clone_from(example);
}
replace_in_buffer(Some(suggestion), editor);
}
Expand Down

0 comments on commit 24181c9

Please sign in to comment.