mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-01 09:22:19 +00:00
Rust 1.73 (#8007)
This commit is contained in:
parent
d6a4283003
commit
2c2ebf952a
9 changed files with 13 additions and 16 deletions
4
.github/workflows/ci.yaml
vendored
4
.github/workflows/ci.yaml
vendored
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -711,7 +711,7 @@ pub fn collect_per_file_ignores(pairs: Vec<PatternPrefixPair>) -> Vec<PerFileIgn
|
|||
for pair in pairs {
|
||||
per_file_ignores
|
||||
.entry(pair.pattern)
|
||||
.or_insert_with(Vec::new)
|
||||
.or_default()
|
||||
.push(pair.prefix);
|
||||
}
|
||||
per_file_ignores
|
||||
|
|
|
@ -2448,7 +2448,7 @@ where
|
|||
|
||||
/// Adds a new entry to the join output.
|
||||
pub fn entry(&mut self, entry: &dyn Format<Context>) -> &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<Context>,
|
||||
entry: &dyn Format<Context>,
|
||||
) -> &mut Self {
|
||||
self.result = self.result.and_then(|_| {
|
||||
self.result = self.result.and_then(|()| {
|
||||
if self.empty {
|
||||
self.empty = false;
|
||||
} else {
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -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()) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
[toolchain]
|
||||
channel = "1.72"
|
||||
channel = "1.73"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue