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
|
- uses: actions/checkout@v4
|
||||||
- name: "Install nightly Rust toolchain"
|
- name: "Install nightly Rust toolchain"
|
||||||
# Only pinned to make caching work, update freely
|
# 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
|
- uses: Swatinem/rust-cache@v2
|
||||||
- name: "Install cargo-udeps"
|
- name: "Install cargo-udeps"
|
||||||
uses: taiki-e/install-action@cargo-udeps
|
uses: taiki-e/install-action@cargo-udeps
|
||||||
- name: "Run cargo-udeps"
|
- name: "Run cargo-udeps"
|
||||||
run: cargo +nightly-2023-06-08 udeps
|
run: cargo +nightly-2023-10-15 udeps
|
||||||
|
|
||||||
python-package:
|
python-package:
|
||||||
name: "python package"
|
name: "python package"
|
||||||
|
|
|
@ -184,7 +184,7 @@ pub(crate) fn collect_per_file_ignores(
|
||||||
for pair in pairs {
|
for pair in pairs {
|
||||||
per_file_ignores
|
per_file_ignores
|
||||||
.entry(pair.pattern)
|
.entry(pair.pattern)
|
||||||
.or_insert_with(Vec::new)
|
.or_default()
|
||||||
.push(pair.prefix);
|
.push(pair.prefix);
|
||||||
}
|
}
|
||||||
per_file_ignores
|
per_file_ignores
|
||||||
|
|
|
@ -711,7 +711,7 @@ pub fn collect_per_file_ignores(pairs: Vec<PatternPrefixPair>) -> Vec<PerFileIgn
|
||||||
for pair in pairs {
|
for pair in pairs {
|
||||||
per_file_ignores
|
per_file_ignores
|
||||||
.entry(pair.pattern)
|
.entry(pair.pattern)
|
||||||
.or_insert_with(Vec::new)
|
.or_default()
|
||||||
.push(pair.prefix);
|
.push(pair.prefix);
|
||||||
}
|
}
|
||||||
per_file_ignores
|
per_file_ignores
|
||||||
|
|
|
@ -2448,7 +2448,7 @@ where
|
||||||
|
|
||||||
/// Adds a new entry to the join output.
|
/// Adds a new entry to the join output.
|
||||||
pub fn entry(&mut self, entry: &dyn Format<Context>) -> &mut Self {
|
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 let Some(with) = &self.with {
|
||||||
if self.has_elements {
|
if self.has_elements {
|
||||||
with.fmt(self.fmt)?;
|
with.fmt(self.fmt)?;
|
||||||
|
@ -2519,7 +2519,7 @@ impl<'a, 'buf, Context> FillBuilder<'a, 'buf, Context> {
|
||||||
separator: &dyn Format<Context>,
|
separator: &dyn Format<Context>,
|
||||||
entry: &dyn Format<Context>,
|
entry: &dyn Format<Context>,
|
||||||
) -> &mut Self {
|
) -> &mut Self {
|
||||||
self.result = self.result.and_then(|_| {
|
self.result = self.result.and_then(|()| {
|
||||||
if self.empty {
|
if self.empty {
|
||||||
self.empty = false;
|
self.empty = false;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -130,10 +130,7 @@ pub(crate) fn missing_whitespace_around_operator(
|
||||||
context: &mut LogicalLinesContext,
|
context: &mut LogicalLinesContext,
|
||||||
) {
|
) {
|
||||||
let mut tokens = line.tokens().iter().peekable();
|
let mut tokens = line.tokens().iter().peekable();
|
||||||
let first_token = tokens.by_ref().find_map(|token| {
|
let first_token = tokens.by_ref().find(|token| !token.kind().is_trivia());
|
||||||
let kind = token.kind();
|
|
||||||
(!kind.is_trivia()).then_some(token)
|
|
||||||
});
|
|
||||||
let Some(mut prev_token) = first_token else {
|
let Some(mut prev_token) = first_token else {
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
|
@ -149,7 +149,7 @@ impl Notebook {
|
||||||
{
|
{
|
||||||
let trailing_newline = reader.seek(SeekFrom::End(-1)).is_ok_and(|_| {
|
let trailing_newline = reader.seek(SeekFrom::End(-1)).is_ok_and(|_| {
|
||||||
let mut buf = [0; 1];
|
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()?;
|
reader.rewind()?;
|
||||||
let mut raw_notebook: RawNotebook = match serde_json::from_reader(reader.by_ref()) {
|
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) {
|
pub fn add_delayed_annotation(&mut self, binding_id: BindingId, annotation_id: BindingId) {
|
||||||
self.delayed_annotations
|
self.delayed_annotations
|
||||||
.entry(binding_id)
|
.entry(binding_id)
|
||||||
.or_insert_with(Vec::new)
|
.or_default()
|
||||||
.push(annotation_id);
|
.push(annotation_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1173,7 +1173,7 @@ impl<'a> SemanticModel<'a> {
|
||||||
pub fn add_rebinding_scope(&mut self, binding_id: BindingId, scope_id: ScopeId) {
|
pub fn add_rebinding_scope(&mut self, binding_id: BindingId, scope_id: ScopeId) {
|
||||||
self.rebinding_scopes
|
self.rebinding_scopes
|
||||||
.entry(binding_id)
|
.entry(binding_id)
|
||||||
.or_insert_with(Vec::new)
|
.or_default()
|
||||||
.push(scope_id);
|
.push(scope_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -286,11 +286,11 @@ impl<'fmt, 'buf> DisplayVisitor<'fmt, 'buf> {
|
||||||
|
|
||||||
impl Visit for DisplayVisitor<'_, '_> {
|
impl Visit for DisplayVisitor<'_, '_> {
|
||||||
fn record_set(&mut self, name: &str, _: OptionSet) {
|
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) {
|
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}")?;
|
write!(self.f, "{name}")?;
|
||||||
|
|
||||||
if field.deprecated.is_some() {
|
if field.deprecated.is_some() {
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
[toolchain]
|
[toolchain]
|
||||||
channel = "1.72"
|
channel = "1.73"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue