Skip to content

Commit 47a4279

Browse files
let-chain for cpp_demangle!
1 parent e9188a5 commit 47a4279

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/symbolize/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -376,10 +376,10 @@ impl<'a> fmt::Display for SymbolName<'a> {
376376
// This may fail to print if the demangled symbol isn't actually
377377
// valid, so handle the error here gracefully by not propagating
378378
// it outwards.
379-
if let Some(ref cpp) = self.cpp_demangled.0 {
380-
if let Ok(s) = cpp.demangle() {
381-
return s.fmt(f);
382-
}
379+
if let Some(ref cpp) = self.cpp_demangled.0
380+
&& let Ok(s) = cpp.demangle()
381+
{
382+
return s.fmt(f);
383383
}
384384
}
385385

@@ -398,10 +398,10 @@ impl<'a> fmt::Debug for SymbolName<'a> {
398398
// This may fail to print if the demangled symbol isn't actually
399399
// valid, so handle the error here gracefully by not propagating
400400
// it outwards.
401-
if let Some(ref cpp) = self.cpp_demangled.0 {
402-
if let Ok(s) = cpp.demangle() {
403-
return s.fmt(f);
404-
}
401+
if let Some(ref cpp) = self.cpp_demangled.0
402+
&& let Ok(s) = cpp.demangle()
403+
{
404+
return s.fmt(f);
405405
}
406406
}
407407

0 commit comments

Comments
 (0)