Skip to content
This repository was archived by the owner on Aug 12, 2021. It is now read-only.

Commit 0bada17

Browse files
committed
Use Try syntax for Option in place of macros or match
1 parent a180656 commit 0bada17

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

terminfo/searcher.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@ use std::path::PathBuf;
2020
#[allow(deprecated)]
2121
pub fn get_dbpath_for_term(term: &str) -> Option<PathBuf> {
2222
let mut dirs_to_search = Vec::new();
23-
let first_char = match term.chars().next() {
24-
Some(c) => c,
25-
None => return None,
26-
};
23+
let first_char = term.chars().next()?;
2724

2825
// Find search directory
2926
if let Some(dir) = env::var_os("TERMINFO") {

0 commit comments

Comments
 (0)