File tree Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,6 @@ use super::{
6262```
6363 */
6464
65-
6665// ----------- attribute names -----------
6766
6867/// Reference to a previous declared backtrace/frame, it's value is id.
@@ -124,17 +123,10 @@ impl TagBacktrace {
124123
125124 /// If `name` matches the top tag of the stack, the tag is popped.
126125 fn pop_with_name ( & mut self , name : & [ u8 ] ) -> Option < CurrentTag > {
127- if self
128- . backtrace
126+ self . backtrace
129127 . 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 ( ) ) ?
138130 }
139131
140132 fn top_mut ( & mut self ) -> Option < & mut CurrentTag > {
You can’t perform that action at this time.
0 commit comments