diff --git a/Cargo.lock b/Cargo.lock index a63b196508fe19..70b48e40fbbe94 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2667,18 +2667,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.41" +version = "1.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c16a64ba9387ef3fdae4f9c1a7f07a0997fce91985c0336f1ddc1822b3b37802" +checksum = "a35fc5b8971143ca348fa6df4f024d4d55264f3468c71ad1c2f365b0a4d58c42" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.41" +version = "1.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d14928354b01c4d6a4f0e549069adef399a284e7995c7ccca94e8a07a5346c59" +checksum = "463fe12d7993d3b327787537ce8dd4dfa058de32fc2b195ef3cde03dc4771e8f" dependencies = [ "proc-macro2", "quote", @@ -2932,9 +2932,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" +checksum = "22049a19f4a68748a168c0fc439f9516686aa045927ff767eca0a85101fb6e73" [[package]] name = "unicode-normalization" diff --git a/Cargo.toml b/Cargo.toml index 695729db04298a..1ca004af7be980 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,7 +45,7 @@ strum = { version = "0.24.1", features = ["strum_macros"] } strum_macros = { version = "0.24.3" } syn = { version = "2.0.15" } test-case = { version = "3.0.0" } -thiserror = { version = "1.0.41" } +thiserror = { version = "1.0.43" } toml = { version = "0.7.2" } # v0.0.1 diff --git a/crates/ruff/Cargo.toml b/crates/ruff/Cargo.toml index 45f4b18c048f87..09a8c50c713f5a 100644 --- a/crates/ruff/Cargo.toml +++ b/crates/ruff/Cargo.toml @@ -73,7 +73,7 @@ shellexpand = { workspace = true } smallvec = { workspace = true } strum = { workspace = true } strum_macros = { workspace = true } -thiserror = { version = "1.0.38" } +thiserror = { version = "1.0.43" } toml = { workspace = true } typed-arena = { version = "2.0.2" } unicode-width = { version = "0.1.10" } diff --git a/crates/ruff_python_formatter/src/lib.rs b/crates/ruff_python_formatter/src/lib.rs index 5320998bbf0614..dcdf4497950be5 100644 --- a/crates/ruff_python_formatter/src/lib.rs +++ b/crates/ruff_python_formatter/src/lib.rs @@ -7,10 +7,9 @@ use ruff_formatter::format_element::tag; use ruff_formatter::prelude::{ dynamic_text, source_position, source_text_slice, text, ContainsNewlines, Formatter, Tag, }; -// `write!` aliased for https://github.com/dtolnay/thiserror/issues/239 use ruff_formatter::{ - format, normalize_newlines, write as ruff_write, Buffer, Format, FormatElement, FormatError, - FormatResult, PrintError, + format, normalize_newlines, write, Buffer, Format, FormatElement, FormatError, FormatResult, + PrintError, }; use ruff_formatter::{Formatted, Printed, SourceCode}; use ruff_python_ast::node::{AnyNodeRef, AstNode, NodeKind}; @@ -55,9 +54,9 @@ where /// Formats the node without comments. Ignores any suppression comments. fn fmt_node(&self, node: &N, f: &mut PyFormatter) -> FormatResult<()> { - ruff_write!(f, [source_position(node.start())])?; + write!(f, [source_position(node.start())])?; self.fmt_fields(node, f)?; - ruff_write!(f, [source_position(node.end())]) + write!(f, [source_position(node.end())]) } /// Formats the node's fields. @@ -228,10 +227,10 @@ impl Format> for VerbatimText { match normalize_newlines(f.context().locator().slice(self.0), ['\r']) { Cow::Borrowed(_) => { - ruff_write!(f, [source_text_slice(self.0, ContainsNewlines::Detect)])?; + write!(f, [source_text_slice(self.0, ContainsNewlines::Detect)])?; } Cow::Owned(cleaned) => { - ruff_write!( + write!( f, [ dynamic_text(&cleaned, Some(self.0.start())),