Skip to content

Commit f686c64

Browse files
committed
clippy: Fix question-mark warnings
1 parent e49e6aa commit f686c64

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/external_urls.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ const DOMAIN_BLOCKLIST: &[&str] = &[
1212
/// Return `None` if the documentation URL host matches a blocked host
1313
pub fn remove_blocked_urls(url: Option<String>) -> Option<String> {
1414
// Handles if documentation URL is None
15-
let url = match url {
16-
Some(url) => url,
17-
None => return None,
18-
};
15+
let url = url?;
1916

2017
// Handles unsuccessful parsing of documentation URL
2118
let parsed_url = match Url::parse(&url) {
@@ -24,10 +21,7 @@ pub fn remove_blocked_urls(url: Option<String>) -> Option<String> {
2421
};
2522

2623
// Extract host string from documentation URL
27-
let url_host = match parsed_url.host_str() {
28-
Some(url_host) => url_host,
29-
None => return None,
30-
};
24+
let url_host = parsed_url.host_str()?;
3125

3226
// Match documentation URL host against blocked host array elements
3327
if domain_is_blocked(url_host) {

0 commit comments

Comments
 (0)