@ -4,7 +4,6 @@ use std::fs::OpenOptions;
use std::io::{Read, Write};
use url::Url;
pub fn add(url: &str) {
let mut file = bookmarks_file();
let entry = format!("{}\n", url);
@ -18,10 +17,7 @@ pub fn content() -> Vec<Url> {
file.read_to_string(&mut content)
.expect("Unable to read file");
content
.lines()
.map(|s| Url::parse(s).unwrap())
.collect()
content.lines().map(|s| Url::parse(s).unwrap()).collect()
}
fn bookmarks_file() -> File {
@ -31,7 +31,7 @@ pub fn get_current_url() -> Option<String> {
Err(_) => None,
None => None
None => None,
@ -324,7 +324,7 @@ fn draw_content(s: &mut Cursive, url: &Url, content: Option<Vec<u8>>) {
Link::Unknown(_, _) => (),
continue;
},
Err(_) => {}
@ -334,7 +334,7 @@ fn draw_content(s: &mut Cursive, url: &Url, content: Option<Vec<u8>>) {
let lines = textwrap::fill(&line, max_size);
for l in lines.lines() {
main_view.add_item(l, String::from("0"));
};
} else {
main_view.add_item(line, String::from("0"));