File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -12,10 +12,7 @@ const DOMAIN_BLOCKLIST: &[&str] = &[
1212/// Return `None` if the documentation URL host matches a blocked host
1313pub 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) {
You can’t perform that action at this time.
0 commit comments