aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Madrid-MencĂ­a2023-01-27 15:43:46 +0000
committerGitHub2023-01-27 15:43:46 +0000
commitd2d302433747ba04dc2fa541c4da9e878d4a5886 (patch)
treef0c76b6bc4a41e98ecb4c1d0b78525d4927a69e5
parent4d548a0ee39c14ba54b672f6b57072cf306c11a9 (diff)
Fix clippy 1.67 warnings (#5697)
-rw-r--r--helix-loader/src/config.rs2
-rw-r--r--helix-loader/src/grammar.rs2
-rw-r--r--helix-term/src/ui/menu.rs2
-rw-r--r--helix-term/src/ui/picker.rs2
-rw-r--r--helix-tui/src/buffer.rs10
-rw-r--r--helix-view/src/theme.rs2
6 files changed, 10 insertions, 10 deletions
diff --git a/helix-loader/src/config.rs b/helix-loader/src/config.rs
index a4c6dcbd..0f329d21 100644
--- a/helix-loader/src/config.rs
+++ b/helix-loader/src/config.rs
@@ -14,7 +14,7 @@ pub fn user_lang_config() -> Result<toml::Value, toml::de::Error> {
.chain([crate::config_dir()].into_iter())
.map(|path| path.join("languages.toml"))
.filter_map(|file| {
- std::fs::read_to_string(&file)
+ std::fs::read_to_string(file)
.map(|config| toml::from_str(&config))
.ok()
})
diff --git a/helix-loader/src/grammar.rs b/helix-loader/src/grammar.rs
index 2aa92475..01c966c8 100644
--- a/helix-loader/src/grammar.rs
+++ b/helix-loader/src/grammar.rs
@@ -515,5 +515,5 @@ pub fn load_runtime_file(language: &str, filename: &str) -> Result<String, std::
.join("queries")
.join(language)
.join(filename);
- std::fs::read_to_string(&path)
+ std::fs::read_to_string(path)
}
diff --git a/helix-term/src/ui/menu.rs b/helix-term/src/ui/menu.rs
index e92578c5..da00aa89 100644
--- a/helix-term/src/ui/menu.rs
+++ b/helix-term/src/ui/menu.rs
@@ -77,7 +77,7 @@ impl<T: Item> Menu<T> {
Self {
options,
editor_data,
- matcher: Box::new(Matcher::default()),
+ matcher: Box::default(),
matches,
cursor: None,
widths: Vec::new(),
diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs
index ccf37eb2..6bd64251 100644
--- a/helix-term/src/ui/picker.rs
+++ b/helix-term/src/ui/picker.rs
@@ -431,7 +431,7 @@ impl<T: Item> Picker<T> {
let mut picker = Self {
options,
editor_data,
- matcher: Box::new(Matcher::default()),
+ matcher: Box::default(),
matches: Vec::new(),
cursor: 0,
prompt,
diff --git a/helix-tui/src/buffer.rs b/helix-tui/src/buffer.rs
index 9b93c405..b1fd4478 100644
--- a/helix-tui/src/buffer.rs
+++ b/helix-tui/src/buffer.rs
@@ -433,7 +433,7 @@ impl Buffer {
(x_offset as u16, y)
}
- pub fn set_spans<'a>(&mut self, x: u16, y: u16, spans: &Spans<'a>, width: u16) -> (u16, u16) {
+ pub fn set_spans(&mut self, x: u16, y: u16, spans: &Spans, width: u16) -> (u16, u16) {
let mut remaining_width = width;
let mut x = x;
for span in &spans.0 {
@@ -454,7 +454,7 @@ impl Buffer {
(x, y)
}
- pub fn set_span<'a>(&mut self, x: u16, y: u16, span: &Span<'a>, width: u16) -> (u16, u16) {
+ pub fn set_span(&mut self, x: u16, y: u16, span: &Span, width: u16) -> (u16, u16) {
self.set_stringn(x, y, span.content.as_ref(), width as usize, span.style)
}
@@ -521,10 +521,10 @@ impl Buffer {
pub fn merge(&mut self, other: &Buffer) {
let area = self.area.union(other.area);
let cell: Cell = Default::default();
- self.content.resize(area.area() as usize, cell.clone());
+ self.content.resize(area.area(), cell.clone());
// Move original content to the appropriate space
- let size = self.area.area() as usize;
+ let size = self.area.area();
for i in (0..size).rev() {
let (x, y) = self.pos_of(i);
// New index in content
@@ -537,7 +537,7 @@ impl Buffer {
// Push content of the other buffer into this one (may erase previous
// data)
- let size = other.area.area() as usize;
+ let size = other.area.area();
for i in 0..size {
let (x, y) = other.pos_of(i);
// New index in content
diff --git a/helix-view/src/theme.rs b/helix-view/src/theme.rs
index 43d4a7a7..8fb15a10 100644
--- a/helix-view/src/theme.rs
+++ b/helix-view/src/theme.rs
@@ -150,7 +150,7 @@ impl Loader {
// Loads the theme data as `toml::Value` first from the user_dir then in default_dir
fn load_toml(&self, path: PathBuf) -> Result<Value> {
- let data = std::fs::read_to_string(&path)?;
+ let data = std::fs::read_to_string(path)?;
let value = toml::from_str(&data)?;
Ok(value)