diff --git a/src/chroot/chroot.rs b/src/chroot/chroot.rs index 9a449a183..fa2e3d768 100644 --- a/src/chroot/chroot.rs +++ b/src/chroot/chroot.rs @@ -15,6 +15,7 @@ extern crate libc; use getopts::{optflag, optopt, getopts, usage}; use c_types::{get_pw_from_args, get_group}; use libc::funcs::posix88::unistd::{execvp, setuid, setgid}; +use std::io::fs::PathExtensions; #[path = "../common/util.rs"] mod util; #[path = "../common/c_types.rs"] mod c_types; diff --git a/src/cut/cut.rs b/src/cut/cut.rs index 2ea176915..0a9cffaac 100644 --- a/src/cut/cut.rs +++ b/src/cut/cut.rs @@ -15,6 +15,7 @@ extern crate getopts; extern crate libc; use std::io::{stdio, File, BufferedWriter, BufferedReader, print}; +use std::io::fs::PathExtensions; use getopts::{optopt, optflag, getopts, usage}; use ranges::Range; diff --git a/src/fmt/linebreak.rs b/src/fmt/linebreak.rs index 9b51f2728..f0880fc69 100644 --- a/src/fmt/linebreak.rs +++ b/src/fmt/linebreak.rs @@ -139,7 +139,9 @@ fn break_knuth_plass<'a, T: Clone + Iterator<&'a WordInfo<'a>>>(mut iter: T, arg // We find identical breakpoints here by comparing addresses of the references. // This is OK because the backing vector is not mutating once we are linebreaking. - if winfo as *const _ == next_break as *const _ { + let winfo_ptr = winfo as *const _; + let next_break_ptr = next_break as *const _; + if winfo_ptr == next_break_ptr { // OK, we found the matching word if break_before { write_newline(args.indent_str, args.ostream); diff --git a/src/mkdir/mkdir.rs b/src/mkdir/mkdir.rs index a0c1966de..559a36c99 100644 --- a/src/mkdir/mkdir.rs +++ b/src/mkdir/mkdir.rs @@ -14,7 +14,7 @@ extern crate getopts; extern crate libc; -use std::io::fs; +use std::io::fs::{mod, PathExtensions}; use std::io::FilePermission; use std::num::strconv; diff --git a/src/rm/rm.rs b/src/rm/rm.rs index 8d1bb84a9..73ede765f 100644 --- a/src/rm/rm.rs +++ b/src/rm/rm.rs @@ -15,6 +15,7 @@ extern crate getopts; extern crate libc; use std::io::{print, stdin, stdio, fs, BufferedReader}; +use std::io::fs::PathExtensions; #[path = "../common/util.rs"] mod util; diff --git a/src/rmdir/rmdir.rs b/src/rmdir/rmdir.rs index ea1e0805f..b85298ef1 100644 --- a/src/rmdir/rmdir.rs +++ b/src/rmdir/rmdir.rs @@ -15,6 +15,7 @@ extern crate getopts; extern crate libc; use std::io::{print, fs}; +use std::io::fs::PathExtensions; #[path = "../common/util.rs"] mod util; diff --git a/src/touch/touch.rs b/src/touch/touch.rs index b0b44ab52..9c13cb7dc 100644 --- a/src/touch/touch.rs +++ b/src/touch/touch.rs @@ -14,6 +14,7 @@ extern crate getopts; extern crate time; use std::io::File; +use std::io::fs::PathExtensions; #[path = "../common/util.rs"] mod util; diff --git a/src/truncate/truncate.rs b/src/truncate/truncate.rs index 31c59c490..832cf38eb 100644 --- a/src/truncate/truncate.rs +++ b/src/truncate/truncate.rs @@ -15,6 +15,7 @@ extern crate getopts; extern crate libc; use std::io::{File, Open, ReadWrite, fs}; +use std::io::fs::PathExtensions; use std::u64; #[path = "../common/util.rs"] diff --git a/src/unlink/unlink.rs b/src/unlink/unlink.rs index fa6fdbe18..6b81f4793 100644 --- a/src/unlink/unlink.rs +++ b/src/unlink/unlink.rs @@ -17,7 +17,7 @@ extern crate getopts; extern crate libc; use std::io; -use std::io::fs; +use std::io::fs::{mod, PathExtensions}; use std::io::print; #[path = "../common/util.rs"] diff --git a/src/wc/wc.rs b/src/wc/wc.rs index a6cb9499d..d1e83d50a 100644 --- a/src/wc/wc.rs +++ b/src/wc/wc.rs @@ -16,6 +16,7 @@ extern crate libc; use std::str::from_utf8; use std::io::{print, File, BufferedReader}; +use std::io::fs::PathExtensions; use std::io::stdio::stdin_raw; use std::result::Result as StdResult; use getopts::Matches; diff --git a/test/mkdir.rs b/test/mkdir.rs index 28a525ffd..7691af97e 100644 --- a/test/mkdir.rs +++ b/test/mkdir.rs @@ -1,5 +1,5 @@ use std::io::process::Command; -use std::io::fs::rmdir; +use std::io::fs::{rmdir, PathExtensions}; static exe: &'static str = "./mkdir"; static test_dir1: &'static str = "mkdir_test1";