mirror of
https://github.com/RGBCube/alejandra
synced 2025-08-01 21:17:45 +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();
|
.collect();
|
||||||
|
|
||||||
let lines: Vec<String> =
|
let lines: Vec<&str> = content.split('\n').collect();
|
||||||
content.split('\n').map(|line| line.to_string()).collect();
|
|
||||||
|
|
||||||
let should_trim_end: bool =
|
let should_trim_end: bool =
|
||||||
!lines.is_empty() && lines[lines.len() - 1].trim().is_empty();
|
!lines.is_empty() && lines[lines.len() - 1].trim().is_empty();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue