We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f146711 commit e784712Copy full SHA for e784712
src/imports.rs
@@ -309,19 +309,24 @@ impl UseTree {
309
}
310
311
312
+ let mut done = false;
313
if aliased_self {
- match self.path.last() {
314
+ match self.path.last_mut() {
315
Some(UseSegment::Ident(_, ref mut old_rename)) => {
316
assert!(old_rename.is_none());
- if let UseSegment::Slf(Some(rename)) = last {
317
+ if let UseSegment::Slf(Some(rename)) = last.clone() {
318
*old_rename = Some(rename);
- return self;
319
+ done = true;
320
321
322
_ => unreachable!(),
323
324
325
326
+ if done {
327
+ return self;
328
+ }
329
+
330
// Normalise foo::{bar} -> foo::bar
331
if let UseSegment::List(ref list) = last {
332
if list.len() == 1 {
0 commit comments