File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
src/librustdoc/html/render Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -511,14 +511,15 @@ impl Hierarchy {
511511 . filter ( |component| matches ! ( component, Component :: Normal ( _) | Component :: ParentDir ) )
512512 . peekable ( ) ;
513513
514+ assert ! ( components. peek( ) . is_some( ) , "empty file path" ) ;
514515 while let Some ( component) = components. next ( ) {
515516 match component {
516517 Component :: Normal ( s) => {
517518 if components. peek ( ) . is_none ( ) {
518519 h. elems . borrow_mut ( ) . insert ( s. to_owned ( ) ) ;
519520 break ;
520521 }
521- let next_h = {
522+ h = {
522523 let mut children = h. children . borrow_mut ( ) ;
523524
524525 if let Some ( existing) = children. get ( s) {
@@ -529,12 +530,9 @@ impl Hierarchy {
529530 new_node
530531 }
531532 } ;
532- h = next_h;
533533 }
534- Component :: ParentDir => {
535- if let Some ( parent) = h. parent . upgrade ( ) {
536- h = parent;
537- }
534+ Component :: ParentDir if let Some ( parent) = h. parent . upgrade ( ) => {
535+ h = parent;
538536 }
539537 _ => { }
540538 }
You can’t perform that action at this time.
0 commit comments