Skip to content

Commit 18cd0c4

Browse files
committed
Fixed overly complicated code as requested in the code review
1 parent d832525 commit 18cd0c4

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/imports.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -318,15 +318,10 @@ impl UseTree {
318318
attrs,
319319
};
320320

321-
let leading_modsep = if context.config.edition() == Edition::Edition2018 {
322-
if a.prefix.to_string().len() > 2 && a.prefix.to_string().starts_with("::") {
323-
true
324-
} else {
325-
false
326-
}
327-
} else {
328-
false
329-
};
321+
let leading_modsep = context.config.edition() == Edition::Edition2018
322+
&& a.prefix.to_string().len() > 2
323+
&& a.prefix.to_string().starts_with("::");
324+
330325
for p in &a.prefix.segments {
331326
if let Some(use_segment) = UseSegment::from_path_segment(context, p, leading_modsep) {
332327
result.path.push(use_segment);

0 commit comments

Comments
 (0)