Skip to content

Commit

Permalink
Address rustc 1.36 compilation regression
Browse files Browse the repository at this point in the history
  • Loading branch information
dubrowgn committed Jul 7, 2019
1 parent 9293e70 commit 5f4d958
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ keywords = ["readline", "tcalc"]
license = "MIT"

[dependencies]
dirs = "2.0.1"
libc = "0.2.7"
unicode-width = "0.1.3"
encode_unicode = "0.1.3"
Expand Down
2 changes: 1 addition & 1 deletion src/char_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ impl error::Error for CharsError {
fn cause(&self) -> Option<&error::Error> {
match *self {
CharsError::NotUtf8 => None,
CharsError::Other(ref e) => e.cause(),
CharsError::Other(ref e) => e.source(),
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ fn filename_complete(path: &str,
esc_char: Option<char>,
break_chars: &BTreeSet<char>)
-> Result<Vec<String>> {
use std::env::{current_dir, home_dir};
use std::env::{current_dir};

let sep = path::MAIN_SEPARATOR;
let (dir_name, file_name) = match path.rfind(sep) {
Expand All @@ -156,7 +156,7 @@ fn filename_complete(path: &str,
let dir_path = Path::new(dir_name);
let dir = if dir_path.starts_with("~") {
// ~[/...]
if let Some(home) = home_dir() {
if let Some(home) = dirs::home_dir() {
match dir_path.strip_prefix("~") {
Ok(rel_path) => home.join(rel_path),
_ => home,
Expand Down
2 changes: 1 addition & 1 deletion src/history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ impl History {
let file = try!(File::open(&path));
let rdr = BufReader::new(file);
for line in rdr.lines() {
self.add(try!(line).as_ref()); // TODO truncate to MAX_LINE
self.add(try!(line)); // TODO truncate to MAX_LINE
}
Ok(())
}
Expand Down
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
//! ```
#![allow(unknown_lints)]

extern crate dirs;
extern crate libc;
#[cfg(unix)]
extern crate nix;
Expand Down Expand Up @@ -933,7 +934,7 @@ impl<'a, C: Completer> Iterator for Iter<'a, C> {
let readline = self.editor.readline(self.prompt);
match readline {
Ok(l) => {
self.editor.add_history_entry(l.as_ref()); // TODO Validate
self.editor.add_history_entry(l.as_str()); // TODO Validate
Some(Ok(l))
}
Err(error::ReadlineError::Eof) => None,
Expand Down
3 changes: 1 addition & 2 deletions src/tty/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ fn get_win_size() -> (usize, usize) {
/// Check TERM environment variable to see if current term is in our
/// unsupported list
fn is_unsupported_term() -> bool {
use std::ascii::AsciiExt;
match std::env::var("TERM") {
Ok(term) => {
for iter in &UNSUPPORTED_TERM {
Expand Down Expand Up @@ -224,7 +223,7 @@ impl RawReader for PosixRawReader {


static SIGWINCH_ONCE: sync::Once = sync::ONCE_INIT;
static SIGWINCH: atomic::AtomicBool = atomic::ATOMIC_BOOL_INIT;
static SIGWINCH: atomic::AtomicBool = atomic::AtomicBool::new(false);

fn install_sigwinch_handler() {
SIGWINCH_ONCE.call_once(|| unsafe {
Expand Down

0 comments on commit 5f4d958

Please sign in to comment.