@@ -45,9 +45,10 @@ macro_rules! impl_string_label {
45
45
$crate:: schedule:: STR_INTERN . intern( self )
46
46
}
47
47
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}" )
51
52
}
52
53
}
53
54
} ;
@@ -97,14 +98,6 @@ impl<T: Clone + Hash + Eq> TypedLabels<T> {
97
98
idx as u64
98
99
}
99
100
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
-
108
101
/// Gets a reference to the label with specified index.
109
102
pub fn get ( & self , idx : u64 ) -> Option < LabelGuard < T > > {
110
103
RwLockReadGuard :: try_map ( self . 0 . read ( ) , |set| set. get_index ( idx as usize ) ) . ok ( )
@@ -193,16 +186,6 @@ impl Labels {
193
186
}
194
187
}
195
188
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
-
206
189
/// Gets a reference to the label with specified index.
207
190
pub fn get < L : ' static > ( & self , key : u64 ) -> Option < LabelGuard < L > > {
208
191
RwLockReadGuard :: try_map ( self . 0 . read ( ) , |type_map| {
0 commit comments