Skip to content

Commit

Permalink
fix some new clippy warnings (#790)
Browse files Browse the repository at this point in the history
* fix some new clippy warnings

* add sophia's change
  • Loading branch information
fdncred authored May 16, 2024
1 parent 1708667 commit a580ea5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
authors = ["JT <[email protected]>", "The Nushell Project Developers"]
authors = ["The Nushell Project Developers"]
description = "A readline-like crate for CLI text input"
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 a580ea5

Please sign in to comment.