diff --git a/crates/taplo-cli/src/commands/format.rs b/crates/taplo-cli/src/commands/format.rs index 08941735d..0407f1e84 100644 --- a/crates/taplo-cli/src/commands/format.rs +++ b/crates/taplo-cli/src/commands/format.rs @@ -13,7 +13,7 @@ use tokio::io::{AsyncReadExt, AsyncWriteExt}; impl Taplo { pub async fn execute_format(&mut self, cmd: FormatCommand) -> Result<(), anyhow::Error> { - if matches!(cmd.files.get(0).map(|it| it.as_str()), Some("-")) { + if matches!(cmd.files.first().map(|it| it.as_str()), Some("-")) { self.format_stdin(cmd).await } else { self.format_files(cmd).await diff --git a/crates/taplo-common/src/schema/mod.rs b/crates/taplo-common/src/schema/mod.rs index 1d63dacf7..65b99a09a 100644 --- a/crates/taplo-common/src/schema/mod.rs +++ b/crates/taplo-common/src/schema/mod.rs @@ -28,7 +28,7 @@ pub mod builtins { #[must_use] pub fn taplo_config_schema() -> Arc { - Arc::new(serde_json::to_value(&schemars::schema_for!(crate::config::Config)).unwrap()) + Arc::new(serde_json::to_value(schemars::schema_for!(crate::config::Config)).unwrap()) } #[must_use] diff --git a/crates/taplo/src/dom/node.rs b/crates/taplo/src/dom/node.rs index af2c51d76..5ccff3dc4 100644 --- a/crates/taplo/src/dom/node.rs +++ b/crates/taplo/src/dom/node.rs @@ -114,7 +114,7 @@ impl Node { pub fn get_matches( &self, pattern: &str, - ) -> Result + ExactSizeIterator, Error> { + ) -> Result, Error> { let glob = globset::Glob::new(pattern) .map_err(QueryError::from)? .compile_matcher(); @@ -132,7 +132,7 @@ impl Node { Node::Array(arr) => { let items = arr.items().read(); for (idx, node) in items.iter().enumerate() { - if glob.is_match(&idx.to_string()) { + if glob.is_match(idx.to_string()) { matched.push((KeyOrIndex::from(idx), node.clone())); } } @@ -211,7 +211,7 @@ impl Node { } } KeyOrIndex::Index(idx) => { - if !glob.is_match(&idx.to_string()) { + if !glob.is_match(idx.to_string()) { return false; } }