Skip to content

Commit 83bdcfd

Browse files
committed
drop clippy suppressions, depend on ruff_formatter
1 parent 79fe8e4 commit 83bdcfd

3 files changed

Lines changed: 4 additions & 8 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/ruff_markdown/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ authors = { workspace = true }
1010
license = { workspace = true }
1111

1212
[dependencies]
13+
ruff_formatter = { workspace = true }
1314
ruff_python_ast = { workspace = true }
1415
ruff_python_formatter = { workspace = true }
1516
ruff_python_trivia = { workspace = true }

crates/ruff_markdown/src/lib.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,8 @@ pub fn format_code_blocks(
103103
"python" | "py" | "python3" | "py3" | "pyi" => {
104104
let options =
105105
settings.to_format_options(py_source_type, &unformatted_code, path);
106-
// Using `Printed::into_code` requires adding `ruff_formatter` as a direct
107-
// dependency, and I suspect that Rust can optimize the closure away regardless.
108-
#[expect(clippy::redundant_closure_for_method_calls)]
109106
format_module_source(&unformatted_code, options)
110-
.map(|formatted| formatted.into_code())
107+
.map(ruff_formatter::Printed::into_code)
111108
.ok()
112109
}
113110
"pycon" => format_pycon_block(&unformatted_code, path, settings),
@@ -169,11 +166,8 @@ fn format_pycon_block(
169166
}
170167
}
171168
let options = settings.to_format_options(PySourceType::Python, &unformatted, path);
172-
// Using `Printed::into_code` requires adding `ruff_formatter` as a direct
173-
// dependency, and I suspect that Rust can optimize the closure away regardless.
174-
#[expect(clippy::redundant_closure_for_method_calls)]
175169
let Ok(formatted) =
176-
format_module_source(&unformatted, options).map(|formatted| formatted.into_code())
170+
format_module_source(&unformatted, options).map(ruff_formatter::Printed::into_code)
177171
else {
178172
continue;
179173
};

0 commit comments

Comments
 (0)