From f8df842dfb08e13aa6559111487901a9642cc742 Mon Sep 17 00:00:00 2001 From: Gustavo Hexsel Date: Wed, 26 Aug 2015 12:50:07 -0400 Subject: [PATCH] Moved code officially to run on nightly since it's a dependency --- Makefile | 4 ++-- src/echo/echo.rs | 3 +-- src/fold/fold.rs | 2 +- src/ptx/ptx.rs | 4 +--- src/stdbuf/libstdbuf.rs | 1 - src/stdbuf/stdbuf.rs | 1 - src/timeout/timeout.rs | 1 - src/users/users.rs | 3 +-- src/yes/yes.rs | 3 +-- 9 files changed, 7 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 798d3e998..8f33f345f 100644 --- a/Makefile +++ b/Makefile @@ -316,11 +316,11 @@ $(BUILDDIR)/uutils: $(SRCDIR)/uutils/uutils.rs $(BUILDDIR)/mkuutils $(RLIB_PATHS $(BUILDDIR)/mkuutils $(BUILDDIR)/gen/uutils.rs $(EXES) $(RUSTC) $(RUSTCBINFLAGS) $(RESERVED_EXTERNS) --emit link,dep-info $(BUILDDIR)/gen/uutils.rs --out-dir $(BUILDDIR) $(if $(ENABLE_STRIP),strip $@) - + # Library for stdbuf $(BUILDDIR)/libstdbuf.$(DYLIB_EXT): $(SRCDIR)/stdbuf/libstdbuf.rs $(SRCDIR)/stdbuf/libstdbuf.c $(SRCDIR)/stdbuf/libstdbuf.h | $(BUILDDIR) cd $(SRCDIR)/stdbuf && \ - $(RUSTC) libstdbuf.rs && \ + $(RUSTC) libstdbuf.rs --extern libc=$(BUILDDIR)/liblibc.rlib && \ $(CC) -c -Wall -Werror -fPIC libstdbuf.c && \ $(CC) $(DYLIB_FLAGS) -o libstdbuf.$(DYLIB_EXT) liblibstdbuf.a libstdbuf.o && \ mv *.$(DYLIB_EXT) $(BUILDDIR) && $(RM) *.o && $(RM) *.a diff --git a/src/echo/echo.rs b/src/echo/echo.rs index 982cc7b68..5e3e3f56a 100644 --- a/src/echo/echo.rs +++ b/src/echo/echo.rs @@ -174,8 +174,7 @@ pub fn uumain(args: Vec) -> i32 { }; if !free.is_empty() { - // NB: Using deprecated connect() until Rust 1.3 becomes stable. - let string = free.connect(" "); + let string = free.join(" "); if options.escape { let mut prev_was_slash = false; let mut iter = string.chars().enumerate(); diff --git a/src/fold/fold.rs b/src/fold/fold.rs index 30ea46a09..200951676 100644 --- a/src/fold/fold.rs +++ b/src/fold/fold.rs @@ -153,7 +153,7 @@ fn fold_file(mut file: BufReader, bytes: bool, spaces: bool, width: match rfind_whitespace(slice) { Some(m) => { let routput = &slice[m + 1 .. slice.chars().count()]; - let ncount = routput.chars().fold(0usize, |out, ch: char| { + let ncount = routput.chars().fold(0, |out, ch: char| { out + match ch { '\t' => 8, '\x08' => if out > 0 { -1 } else { 0 }, diff --git a/src/ptx/ptx.rs b/src/ptx/ptx.rs index b7d94c7e7..0569d130b 100644 --- a/src/ptx/ptx.rs +++ b/src/ptx/ptx.rs @@ -420,9 +420,7 @@ fn adjust_tex_str(context: &str) -> String { let ws_reg = Regex::new(r"[\t\n\v\f\r ]").unwrap(); let mut fix: String = ws_reg.replace_all(context, " ").trim().to_string(); let mapped_chunks: Vec = fix.chars().map(tex_mapper).collect(); - // NB: Using deprecated connect() until Rust 1.3 becomes stable. - // When 1.3 is released, replace connect() with join(). - fix = mapped_chunks.connect(""); + fix = mapped_chunks.join(""); fix } diff --git a/src/stdbuf/libstdbuf.rs b/src/stdbuf/libstdbuf.rs index 1dbb0587b..6ff620a99 100644 --- a/src/stdbuf/libstdbuf.rs +++ b/src/stdbuf/libstdbuf.rs @@ -1,6 +1,5 @@ #![crate_name = "libstdbuf"] #![crate_type = "staticlib"] -#![feature(libc)] extern crate libc; diff --git a/src/stdbuf/stdbuf.rs b/src/stdbuf/stdbuf.rs index 988d89085..0be155afa 100644 --- a/src/stdbuf/stdbuf.rs +++ b/src/stdbuf/stdbuf.rs @@ -1,5 +1,4 @@ #![crate_name = "stdbuf"] -#![feature(negate_unsigned)] /* * This file is part of the uutils coreutils package. diff --git a/src/timeout/timeout.rs b/src/timeout/timeout.rs index 6b3a43b76..8a16c2b38 100644 --- a/src/timeout/timeout.rs +++ b/src/timeout/timeout.rs @@ -1,5 +1,4 @@ #![crate_name = "timeout"] -#![feature(process_id)] /* * This file is part of the uutils coreutils package. diff --git a/src/users/users.rs b/src/users/users.rs index 47b44c541..d46092f8b 100644 --- a/src/users/users.rs +++ b/src/users/users.rs @@ -117,7 +117,6 @@ fn exec(filename: &str) { if users.len() > 0 { users.sort(); - // NB: Using deprecated connect() until Rust 1.3 becomes stable. - println!("{}", users.connect(" ")); + println!("{}", users.join(" ")); } } diff --git a/src/yes/yes.rs b/src/yes/yes.rs index a3dd2e30a..52af0f53a 100644 --- a/src/yes/yes.rs +++ b/src/yes/yes.rs @@ -50,8 +50,7 @@ pub fn uumain(args: Vec) -> i32 { let string = if matches.free.is_empty() { "y".to_string() } else { - // NB: Using deprecated connect() until Rust 1.3 becomes stable. - matches.free.connect(" ") + matches.free.join(" ") }; exec(&string[..]);