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

22 lines
469 B
Rust

use config;
const BOOKMARKS_FILE: &str = "bookmarks.gph";
pub fn as_raw_menu() -> String {
let mut out = vec![format!("i** bookmarks **\r\ni")];
config::load(BOOKMARKS_FILE)
.and_then(|reader| reader.read(&mut out))
.map_err(|e| {
out.push(format!("3{}", e));
e
});
out.join("\r\n")
}
// save a single history entry
pub fn save(label: &str, url: &str) {
config::append(BOOKMARKS_FILE, label, url);
}