kkawakam / rustyline

Readline Implementation in Rust
https://crates.io/crates/rustyline/
MIT License
1.57k stars 178 forks source link

Improve `save_history` #88

Open gwenn opened 8 years ago

gwenn commented 8 years ago

See https://github.com/danburkert/ksql/blob/master/src/main.rs#L199

Yamakaky commented 8 years ago

I don't understand, it's expected because the two calls don't output the same Error. BTW, since ReadlineError can contain a io::Error, you can do

fs::create_dir_all(history_path.parent().unwrap())
   .map_err(Into::into)
   .and_then(|_| readline.save_history(&history_path))

A better improvement would be to use https://github.com/brson/error-chain. Waiting for https://github.com/brson/error-chain/issues/53.

Yamakaky commented 8 years ago

Waiting for https://github.com/brson/error-chain/pull/55 to be merged.

walles commented 2 years ago

@Yamakaky both https://github.com/rust-lang-deprecated/error-chain/issues/53 and https://github.com/rust-lang-deprecated/error-chain/pull/55 are merged.

Is this ticket still relevant?

Yamakaky commented 2 years ago

error-chain doesn't seem to be used anymore so no !

walles commented 2 years ago

@gwenn, @Yamakaky says this ticket isn't relevant any more.

Can it be closed?