~julienxx/castor

bookmarks: simplify is_valid v1 APPLIED

link2xt: 1
 bookmarks: simplify is_valid

 1 files changed, 1 insertions(+), 4 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~julienxx/castor/patches/13032/mbox | git am -3
Learn more about email & git

[PATCH] bookmarks: simplify is_valid Export this patch

This also fixes clippy warning, which suggests to use matches! macro.
---
 src/bookmarks.rs | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/bookmarks.rs b/src/bookmarks.rs
index 6ae6a96..3b7f68b 100644
--- a/src/bookmarks.rs
+++ b/src/bookmarks.rs
@@ -7,10 +7,7 @@ use std::io::{Read, Write};
use url::Url;

pub fn is_valid(url: &str) -> bool {
    match Url::parse(&url) {
        Ok(_) => true,
        _ => false,
    }
    Url::parse(&url).is_ok()
}

pub fn add(url: &str) {
-- 
2.28.0
Thanks!