Skip to content

Commit

Permalink
"Change match for unwrap-or"
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisDavison committed Aug 28, 2023
1 parent 8b11f83 commit 551095c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/utility.rs
Expand Up @@ -13,10 +13,7 @@ const HEIRARCHY_SPLITTERS: [char; 2] = [':', '/'];
/// argument is `None`, then the current directory will be used; otherwise,
/// the given path will be used.
pub fn get_files(root: Option<String>) -> Result<Vec<String>, PatternError> {
let dir = match root {
Some(d) => d,
None => ".".to_string(),
};
let dir = root.unwrap_or(".".to_string());
let mut files = Vec::new();
let txts = glob(&format!("{}/**/*.txt", dir))?;
let mds = glob(&format!("{}/**/*.md", dir))?;
Expand Down

0 comments on commit 551095c

Please sign in to comment.