diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 382488af3a..12cef9e4a9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -225,12 +225,12 @@ jobs: - uses: actions/checkout@v4 - name: "Install nightly Rust toolchain" # Only pinned to make caching work, update freely - run: rustup toolchain install nightly-2023-06-08 + run: rustup toolchain install nightly-2023-10-15 - uses: Swatinem/rust-cache@v2 - name: "Install cargo-udeps" uses: taiki-e/install-action@cargo-udeps - name: "Run cargo-udeps" - run: cargo +nightly-2023-06-08 udeps + run: cargo +nightly-2023-10-15 udeps python-package: name: "python package" diff --git a/crates/flake8_to_ruff/src/parser.rs b/crates/flake8_to_ruff/src/parser.rs index 468992ddf9..63ab9b6800 100644 --- a/crates/flake8_to_ruff/src/parser.rs +++ b/crates/flake8_to_ruff/src/parser.rs @@ -184,7 +184,7 @@ pub(crate) fn collect_per_file_ignores( for pair in pairs { per_file_ignores .entry(pair.pattern) - .or_insert_with(Vec::new) + .or_default() .push(pair.prefix); } per_file_ignores diff --git a/crates/ruff_cli/src/args.rs b/crates/ruff_cli/src/args.rs index 156ca6a616..8ac464d59d 100644 --- a/crates/ruff_cli/src/args.rs +++ b/crates/ruff_cli/src/args.rs @@ -711,7 +711,7 @@ pub fn collect_per_file_ignores(pairs: Vec) -> Vec) -> &mut Self { - self.result = self.result.and_then(|_| { + self.result = self.result.and_then(|()| { if let Some(with) = &self.with { if self.has_elements { with.fmt(self.fmt)?; @@ -2519,7 +2519,7 @@ impl<'a, 'buf, Context> FillBuilder<'a, 'buf, Context> { separator: &dyn Format, entry: &dyn Format, ) -> &mut Self { - self.result = self.result.and_then(|_| { + self.result = self.result.and_then(|()| { if self.empty { self.empty = false; } else { diff --git a/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/missing_whitespace_around_operator.rs b/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/missing_whitespace_around_operator.rs index c8ded09737..aac7247898 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/missing_whitespace_around_operator.rs +++ b/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/missing_whitespace_around_operator.rs @@ -130,10 +130,7 @@ pub(crate) fn missing_whitespace_around_operator( context: &mut LogicalLinesContext, ) { let mut tokens = line.tokens().iter().peekable(); - let first_token = tokens.by_ref().find_map(|token| { - let kind = token.kind(); - (!kind.is_trivia()).then_some(token) - }); + let first_token = tokens.by_ref().find(|token| !token.kind().is_trivia()); let Some(mut prev_token) = first_token else { return; }; diff --git a/crates/ruff_notebook/src/notebook.rs b/crates/ruff_notebook/src/notebook.rs index 34562473c4..611b90cbee 100644 --- a/crates/ruff_notebook/src/notebook.rs +++ b/crates/ruff_notebook/src/notebook.rs @@ -149,7 +149,7 @@ impl Notebook { { let trailing_newline = reader.seek(SeekFrom::End(-1)).is_ok_and(|_| { let mut buf = [0; 1]; - reader.read_exact(&mut buf).is_ok_and(|_| buf[0] == b'\n') + reader.read_exact(&mut buf).is_ok_and(|()| buf[0] == b'\n') }); reader.rewind()?; let mut raw_notebook: RawNotebook = match serde_json::from_reader(reader.by_ref()) { diff --git a/crates/ruff_python_semantic/src/model.rs b/crates/ruff_python_semantic/src/model.rs index 7ab3fed0d3..c9187aa39f 100644 --- a/crates/ruff_python_semantic/src/model.rs +++ b/crates/ruff_python_semantic/src/model.rs @@ -1159,7 +1159,7 @@ impl<'a> SemanticModel<'a> { pub fn add_delayed_annotation(&mut self, binding_id: BindingId, annotation_id: BindingId) { self.delayed_annotations .entry(binding_id) - .or_insert_with(Vec::new) + .or_default() .push(annotation_id); } @@ -1173,7 +1173,7 @@ impl<'a> SemanticModel<'a> { pub fn add_rebinding_scope(&mut self, binding_id: BindingId, scope_id: ScopeId) { self.rebinding_scopes .entry(binding_id) - .or_insert_with(Vec::new) + .or_default() .push(scope_id); } diff --git a/crates/ruff_workspace/src/options_base.rs b/crates/ruff_workspace/src/options_base.rs index d13f5545db..60cbbe6fac 100644 --- a/crates/ruff_workspace/src/options_base.rs +++ b/crates/ruff_workspace/src/options_base.rs @@ -286,11 +286,11 @@ impl<'fmt, 'buf> DisplayVisitor<'fmt, 'buf> { impl Visit for DisplayVisitor<'_, '_> { fn record_set(&mut self, name: &str, _: OptionSet) { - self.result = self.result.and_then(|_| writeln!(self.f, "{name}")); + self.result = self.result.and_then(|()| writeln!(self.f, "{name}")); } fn record_field(&mut self, name: &str, field: OptionField) { - self.result = self.result.and_then(|_| { + self.result = self.result.and_then(|()| { write!(self.f, "{name}")?; if field.deprecated.is_some() { diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 7e8f0a9aab..50fa4928b9 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.72" +channel = "1.73"