fix some new clippy warnings (#790)

* fix some new clippy warnings

* add sophia's change
This commit is contained in:
Darren Schroeder 2024-05-16 07:36:16 -05:00 committed by GitHub
parent 1708667303
commit a580ea56d4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 4 deletions

View File

@ -1,11 +1,11 @@
[package]
authors = ["JT <jonathan.d.turner@gmail.com>", "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

View File

@ -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()
}
@ -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;
}

View File

@ -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);
}