fix bookmarks

pull/6/head
dvkt 5 years ago
parent 9bb2d1f8bb
commit 73ea0fa1c6

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

@ -1,4 +1,5 @@
use config;
use std::io::BufRead;
const HISTORY_FILE: &str = "history.gph";
@ -7,7 +8,7 @@ pub fn as_raw_menu() -> String {
config::load(HISTORY_FILE)
.and_then(|reader| {
let lines = reader.lines();
let mut lines = reader.lines();
while let Some(Ok(line)) = lines.next() {
out.insert(1, line);
}

Loading…
Cancel
Save