Skip to content

Commit e5be9a5

Browse files
committed
improve MyLinkType::full_print_on_one_line()
1 parent 24ba14d commit e5be9a5

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/networking/types/my_link_type.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,14 @@ impl MyLinkType {
5050
| Self::LinuxSll2(l)
5151
| Self::Unsupported(l) => {
5252
format!(
53-
"{}: {} ({})",
53+
"{}: {}{}",
5454
link_type_translation(language),
5555
l.get_name().unwrap_or_else(|_| l.0.to_string()),
56-
l.get_description().unwrap_or_else(|_| String::new())
56+
if let Ok(desc) = l.get_description() {
57+
format!(" ({desc})")
58+
} else {
59+
String::new()
60+
}
5761
)
5862
}
5963
Self::NotYetAssigned => {

0 commit comments

Comments
 (0)