We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 09a7b25 commit 254a478Copy full SHA for 254a478
1 file changed
src/utils.rs
@@ -6,11 +6,9 @@ pub fn check_throttling_error(string: &str) -> Option<u64> {
6
static RE: LazyLock<Regex> = LazyLock::new(|| {
7
Regex::new(r"Guest logins are restricted to one per IP address per (\d+) seconds").unwrap()
8
});
9
- if let Some(captures) = RE.captures(string) {
10
- captures.get(1).unwrap().as_str().parse::<u64>().ok()
11
- } else {
12
- None
13
- }
+ let captures = RE.captures(string)?;
+ let duration_capture = captures.get(1)?;
+ duration_capture.as_str().parse::<u64>().ok()
14
}
15
16
/// Parse host from plain domain name or URL.
0 commit comments