mirror of
https://github.com/nushell/reedline.git
synced 2024-10-03 20:37:50 +03:00
fix some new clippy warnings (#790)
* fix some new clippy warnings * add sophia's change
This commit is contained in:
parent
1708667303
commit
a580ea56d4
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user