Skip to content

Commit

Permalink
fix unwrap() crash
Browse files Browse the repository at this point in the history
  • Loading branch information
kamiyaa committed Oct 9, 2023
1 parent 8412f05 commit cfcefaf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ui/tab_list_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@ impl TabLabel {
let home_dir_str = home_dir.to_string_lossy().into_owned();
full_path_str = full_path_str.replace(&home_dir_str, "~");
}
eprintln!("full_path_str: {:?}", full_path_str);
let last = Path::new(&full_path_str)
.file_name()
.unwrap()
.unwrap_or_default()
.to_str()
.unwrap()
.unwrap_or_default()
.to_string();
TabLabel {
long: full_path_str,
Expand Down

0 comments on commit cfcefaf

Please sign in to comment.