This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -41,8 +41,7 @@ pub trait CrateDef {
4141
4242 /// Return the fully qualified name of the current definition.
4343 fn name ( & self ) -> Symbol {
44- let def_id = self . def_id ( ) ;
45- with ( |cx| cx. def_name ( def_id, false ) )
44+ self . def_id ( ) . name ( )
4645 }
4746
4847 /// Return a trimmed name of this definition.
@@ -56,8 +55,7 @@ pub trait CrateDef {
5655 /// For example, this function may shorten `std::vec::Vec` to just `Vec`,
5756 /// as long as there is no other `Vec` importable anywhere.
5857 fn trimmed_name ( & self ) -> Symbol {
59- let def_id = self . def_id ( ) ;
60- with ( |cx| cx. def_name ( def_id, true ) )
58+ self . def_id ( ) . trimmed_name ( )
6159 }
6260
6361 /// Return information about the crate where this definition is declared.
Original file line number Diff line number Diff line change @@ -48,10 +48,7 @@ pub type CrateNum = usize;
4848
4949impl Debug for DefId {
5050 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
51- f. debug_struct ( "DefId" )
52- . field ( "id" , & self . 0 )
53- . field ( "name" , & with ( |cx| cx. def_name ( * self , false ) ) )
54- . finish ( )
51+ f. debug_struct ( "DefId" ) . field ( "id" , & self . 0 ) . field ( "name" , & self . name ( ) ) . finish ( )
5552 }
5653}
5754
You can’t perform that action at this time.
0 commit comments