Skip to content

Commit

Permalink
fix: bail if home dir (~) cannot be found
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamAnimate committed Nov 23, 2024
1 parent 49f25b0 commit 5aff9c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ lazy_static::lazy_static!{

fn parse_playlist(file: BufReader<File>) -> Result<(), Box<dyn std::error::Error>> {
let mut lines = PLAYLIST.write().unwrap();
let home = std::env::var("HOME").unwrap_or_else(|_| String::new());
let home = std::env::var("HOME").expect("Cannot find HOME dir");
for line in file.lines() {
let mut line = match line {
Ok(k) => k,
Expand Down

0 comments on commit 5aff9c5

Please sign in to comment.