File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -538,16 +538,21 @@ impl ast::UseTree {
538538 /// `foo::bar` -> `{foo::bar}`
539539 ///
540540 /// `{foo::bar}` -> `{foo::bar}`
541- pub fn wrap_in_tree_list ( & self ) {
542- if self . path ( ) . is_none ( ) {
543- return ;
541+ pub fn wrap_in_tree_list ( & self ) -> Option < ( ) > {
542+ if self . use_tree_list ( ) . is_some ( )
543+ && self . path ( ) . is_none ( )
544+ && self . star_token ( ) . is_none ( )
545+ && self . rename ( ) . is_none ( )
546+ {
547+ return None ;
544548 }
545549 let subtree = self . clone_subtree ( ) . clone_for_update ( ) ;
546550 ted:: remove_all_iter ( self . syntax ( ) . children_with_tokens ( ) ) ;
547551 ted:: append_child (
548552 self . syntax ( ) ,
549553 make:: use_tree_list ( once ( subtree) ) . clone_for_update ( ) . syntax ( ) ,
550554 ) ;
555+ Some ( ( ) )
551556 }
552557}
553558
You can’t perform that action at this time.
0 commit comments