@@ -45,9 +45,10 @@ macro_rules! impl_string_label {
4545 $crate:: schedule:: STR_INTERN . intern( self )
4646 }
4747 fn fmt( idx: u64 , f: & mut std:: fmt:: Formatter ) -> std:: fmt:: Result {
48- $crate:: schedule:: STR_INTERN
49- . scope( idx, |s: & Self | write!( f, "{s}" ) )
50- . ok_or( :: std:: fmt:: Error ) ?
48+ let s = $crate:: schedule:: STR_INTERN
49+ . get( idx)
50+ . ok_or( std:: fmt:: Error ) ?;
51+ write!( f, "{s}" )
5152 }
5253 }
5354 } ;
@@ -97,14 +98,6 @@ impl<T: Clone + Hash + Eq> TypedLabels<T> {
9798 idx as u64
9899 }
99100
100- /// Allows one to peek at an interned label and execute code,
101- /// optionally returning a value.
102- ///
103- /// Returns `None` if there is no interned label with that key.
104- pub fn scope < U > ( & self , idx : u64 , f : impl FnOnce ( & T ) -> U ) -> Option < U > {
105- self . 0 . read ( ) . get_index ( idx as usize ) . map ( f)
106- }
107-
108101 /// Gets a reference to the label with specified index.
109102 pub fn get ( & self , idx : u64 ) -> Option < LabelGuard < T > > {
110103 RwLockReadGuard :: try_map ( self . 0 . read ( ) , |set| set. get_index ( idx as usize ) ) . ok ( )
@@ -193,16 +186,6 @@ impl Labels {
193186 }
194187 }
195188
196- /// Allows one to peek at an interned label and execute code,
197- /// optionally returning a value.
198- ///
199- /// Returns `None` if there is no interned label with that key.
200- pub fn scope < L : ' static , U > ( & self , key : u64 , f : impl FnOnce ( & L ) -> U ) -> Option < U > {
201- let type_map = self . 0 . read ( ) ;
202- let set = type_map. get :: < IndexSet < L > > ( ) ?;
203- set. get_index ( key as usize ) . map ( f)
204- }
205-
206189 /// Gets a reference to the label with specified index.
207190 pub fn get < L : ' static > ( & self , key : u64 ) -> Option < LabelGuard < L > > {
208191 RwLockReadGuard :: try_map ( self . 0 . read ( ) , |type_map| {
0 commit comments