summaryrefslogtreecommitdiff
path: root/src/env/fs.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-05-18 21:32:40 +0200
committerLaurenz <laurmaedje@gmail.com>2021-05-18 21:32:40 +0200
commit118fc1014bcfc5585fd3ce32348fbfe14bdc05a9 (patch)
tree51ef7937188776d0343196fda207c77e732859d1 /src/env/fs.rs
parent7025590405623b99ec93aa6eddc9fc909e8f83a8 (diff)
Leaner argument parsing
Diffstat (limited to 'src/env/fs.rs')
-rw-r--r--src/env/fs.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/env/fs.rs b/src/env/fs.rs
index 45850c69..969ee9e0 100644
--- a/src/env/fs.rs
+++ b/src/env/fs.rs
@@ -130,11 +130,7 @@ impl FsLoader {
fn parse_face(&mut self, path: &Path, face: &Face<'_>, index: u32) -> io::Result<()> {
fn find_name(face: &Face, name_id: u16) -> Option<String> {
face.names().find_map(|entry| {
- if entry.name_id() == name_id {
- entry.to_string()
- } else {
- None
- }
+ (entry.name_id() == name_id).then(|| entry.to_string()).flatten()
})
}