mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-27 20:42:10 +00:00
refactor(ruff): Implement doc_lines_from_tokens
as iterator (#3124)
This is a nit refactor... It implements the extraction of document lines as an iterator instead of a Vector to avoid the extra allocation.
This commit is contained in:
parent
bc3a9ce003
commit
262e768fd3
6 changed files with 51 additions and 37 deletions
|
@ -81,7 +81,7 @@ pub fn lint_path(
|
|||
};
|
||||
|
||||
// Read the file from disk.
|
||||
let contents = fs::read_file(path)?;
|
||||
let contents = std::fs::read_to_string(path)?;
|
||||
|
||||
// Lint the file.
|
||||
let (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue