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:
Micha Reiser 2023-02-22 15:22:06 +01:00 committed by GitHub
parent bc3a9ce003
commit 262e768fd3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 51 additions and 37 deletions

View file

@ -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 (