Skip to content

Commit 377f1b6

Browse files
committed
Use let...else
1 parent 7e4e37e commit 377f1b6

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/posts.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,11 @@ impl Post {
119119
lazy_static::lazy_static! {
120120
static ref R: Regex = Regex::new(r"(?P<name>[^<]*) <(?P<url>[^>]+)>").unwrap();
121121
}
122-
let captures = match R.captures(&s) {
123-
Some(c) => c,
124-
None => panic!(
122+
let Some(captures) = R.captures(&s) else {
123+
panic!(
125124
"team from path `{}` should have format `$name <$url>`",
126125
path.display()
127-
),
126+
)
128127
};
129128
(
130129
Some(captures["name"].to_string()),

0 commit comments

Comments
 (0)