Skip to content

Commit

Permalink
get_opts_db_name_from_url: use Option::filter instead of and_then
Browse files Browse the repository at this point in the history
  • Loading branch information
blackbeam committed Sep 14, 2023
1 parent 4f09530 commit 31d040f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/opts/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1347,7 +1347,7 @@ fn get_opts_db_name_from_url(url: &Url) -> Option<String> {
.decode_utf8_lossy()
.into_owned()
})
.and_then(|db| if db.is_empty() { None } else { Some(db) })
.filter(|db| !db.is_empty())
} else {
None
}
Expand Down

0 comments on commit 31d040f

Please sign in to comment.