removed redundant derefs

This commit is contained in:
Anton-4 2022-03-08 13:56:43 +01:00
parent 0637344361
commit dd85caa85a
No known key found for this signature in database
GPG key ID: C954D6E0F9C0ABFD

View file

@ -315,9 +315,9 @@ fn starts_with_newline(expr: &Expr) -> bool {
match expr {
SpaceBefore(_, comment_or_newline) => {
if !(**comment_or_newline).is_empty() {
if !comment_or_newline.is_empty() {
// safe because we check the length before
(**comment_or_newline).get(0).unwrap().is_newline()
comment_or_newline.get(0).unwrap().is_newline()
} else {
false
}
@ -325,7 +325,7 @@ fn starts_with_newline(expr: &Expr) -> bool {
SpaceAfter(_, comment_or_newline) => {
if !(**comment_or_newline).is_empty() {
// safe because we check the length before
(**comment_or_newline).get(0).unwrap().is_newline()
comment_or_newline.get(0).unwrap().is_newline()
} else {
false
}