File tree 1 file changed +3
-11
lines changed
1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,6 @@ use super::{
62
62
```
63
63
*/
64
64
65
-
66
65
// ----------- attribute names -----------
67
66
68
67
/// Reference to a previous declared backtrace/frame, it's value is id.
@@ -124,17 +123,10 @@ impl TagBacktrace {
124
123
125
124
/// If `name` matches the top tag of the stack, the tag is popped.
126
125
fn pop_with_name ( & mut self , name : & [ u8 ] ) -> Option < CurrentTag > {
127
- if self
128
- . backtrace
126
+ self . backtrace
129
127
. last ( )
130
- . map ( |t| t. matches ( name) )
131
- . unwrap_or_default ( )
132
- {
133
- // There is at least one element in backtrace, hence this unwrap is safe.
134
- Some ( self . backtrace . pop ( ) . unwrap ( ) )
135
- } else {
136
- None
137
- }
128
+ . is_some_and ( |t| t. matches ( name) )
129
+ . then ( || self . backtrace . pop ( ) ) ?
138
130
}
139
131
140
132
fn top_mut ( & mut self ) -> Option < & mut CurrentTag > {
You can’t perform that action at this time.
0 commit comments