Browse Source

bookmarks: simplify is_valid

This also fixes clippy warning, which suggests to use matches! macro.
openbsd
link2xt 8 months ago
parent
commit
aec32347d3
1 changed files with 1 additions and 4 deletions
  1. 1
    4
      src/bookmarks.rs

+ 1
- 4
src/bookmarks.rs View File

@@ -7,10 +7,7 @@ use std::io::{Read, Write};
7 7
 use url::Url;
8 8
 
9 9
 pub fn is_valid(url: &str) -> bool {
10
-    match Url::parse(&url) {
11
-        Ok(_) => true,
12
-        _ => false,
13
-    }
10
+    Url::parse(&url).is_ok()
14 11
 }
15 12
 
16 13
 pub fn add(url: &str) {

Loading…
Cancel
Save