Replace dirs with dirs-next

This commit is contained in:
brightly-salty
2020-12-15 06:59:26 -06:00
parent 7bde174b40
commit 4854da4805
4 changed files with 28 additions and 17 deletions

View File

@@ -281,7 +281,7 @@ impl Machine {
}
fn compile_scryerrc(&mut self) {
let mut path = match dirs::home_dir() {
let mut path = match dirs_next::home_dir() {
Some(path) => path,
None => return,
};

View File

@@ -47,7 +47,7 @@ pub mod readline {
#[inline]
pub fn new(pending_input: String) -> Self {
let mut rl = Editor::<()>::new();
if let Some(mut path) = dirs::home_dir() {
if let Some(mut path) = dirs_next::home_dir() {
path.push(HISTORY_FILE);
if path.exists() {
if rl.load_history(&path).is_err() {
@@ -55,7 +55,7 @@ pub mod readline {
}
}
}
rl.bind_sequence(KeyEvent::from('\t'), Cmd::Insert(1, "\t".to_string()));
ReadlineStream { rl, pending_input: Cursor::new(pending_input) }
}
@@ -95,7 +95,7 @@ pub mod readline {
}
fn save_history(&mut self) {
if let Some(mut path) = dirs::home_dir() {
if let Some(mut path) = dirs_next::home_dir() {
path.push(HISTORY_FILE);
if path.exists() {
if self.rl.append_history(&path).is_err() {