You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
phetch/src/bookmarks.rs

23 lines
483 B
Rust

use config;
5 years ago
use std::io::Read;
const BOOKMARKS_FILE: &str = "bookmarks.gph";
pub fn as_raw_menu() -> String {
5 years ago
let mut out = format!("i** bookmarks **\r\ni\r\n");
config::load(BOOKMARKS_FILE)
5 years ago
.and_then(|mut reader| reader.read_to_string(&mut out))
.map_err(|e| {
5 years ago
out = format!("3{}", e);
e
});
5 years ago
out
}
// save a single history entry
pub fn save(label: &str, url: &str) {
config::append(BOOKMARKS_FILE, label, url);
}