mirror of
https://github.com/RGBCube/alejandra
synced 2025-07-30 12:07:46 +00:00
refactor: avoid unnecesary clone
This commit is contained in:
parent
3184be7cbe
commit
6acd441a1f
1 changed files with 1 additions and 2 deletions
|
@ -43,8 +43,7 @@ pub(crate) fn rule(
|
|||
})
|
||||
.collect();
|
||||
|
||||
let lines: Vec<String> =
|
||||
content.split('\n').map(|line| line.to_string()).collect();
|
||||
let lines: Vec<&str> = content.split('\n').collect();
|
||||
|
||||
let should_trim_end: bool =
|
||||
!lines.is_empty() && lines[lines.len() - 1].trim().is_empty();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue