1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 11:07:44 +00:00

Merge pull request #685 from hexsel/depend-on-nightly-officially

Moved code officially to run on nightly since it's a dependency
This commit is contained in:
Michael Gehring 2015-08-26 21:06:04 +02:00
commit 314a254d1f
9 changed files with 7 additions and 15 deletions

View file

@ -316,11 +316,11 @@ $(BUILDDIR)/uutils: $(SRCDIR)/uutils/uutils.rs $(BUILDDIR)/mkuutils $(RLIB_PATHS
$(BUILDDIR)/mkuutils $(BUILDDIR)/gen/uutils.rs $(EXES) $(BUILDDIR)/mkuutils $(BUILDDIR)/gen/uutils.rs $(EXES)
$(RUSTC) $(RUSTCBINFLAGS) $(RESERVED_EXTERNS) --emit link,dep-info $(BUILDDIR)/gen/uutils.rs --out-dir $(BUILDDIR) $(RUSTC) $(RUSTCBINFLAGS) $(RESERVED_EXTERNS) --emit link,dep-info $(BUILDDIR)/gen/uutils.rs --out-dir $(BUILDDIR)
$(if $(ENABLE_STRIP),strip $@) $(if $(ENABLE_STRIP),strip $@)
# Library for stdbuf # Library for stdbuf
$(BUILDDIR)/libstdbuf.$(DYLIB_EXT): $(SRCDIR)/stdbuf/libstdbuf.rs $(SRCDIR)/stdbuf/libstdbuf.c $(SRCDIR)/stdbuf/libstdbuf.h | $(BUILDDIR) $(BUILDDIR)/libstdbuf.$(DYLIB_EXT): $(SRCDIR)/stdbuf/libstdbuf.rs $(SRCDIR)/stdbuf/libstdbuf.c $(SRCDIR)/stdbuf/libstdbuf.h | $(BUILDDIR)
cd $(SRCDIR)/stdbuf && \ cd $(SRCDIR)/stdbuf && \
$(RUSTC) libstdbuf.rs && \ $(RUSTC) libstdbuf.rs --extern libc=$(BUILDDIR)/liblibc.rlib && \
$(CC) -c -Wall -Werror -fPIC libstdbuf.c && \ $(CC) -c -Wall -Werror -fPIC libstdbuf.c && \
$(CC) $(DYLIB_FLAGS) -o libstdbuf.$(DYLIB_EXT) liblibstdbuf.a libstdbuf.o && \ $(CC) $(DYLIB_FLAGS) -o libstdbuf.$(DYLIB_EXT) liblibstdbuf.a libstdbuf.o && \
mv *.$(DYLIB_EXT) $(BUILDDIR) && $(RM) *.o && $(RM) *.a mv *.$(DYLIB_EXT) $(BUILDDIR) && $(RM) *.o && $(RM) *.a

View file

@ -174,8 +174,7 @@ pub fn uumain(args: Vec<String>) -> i32 {
}; };
if !free.is_empty() { if !free.is_empty() {
// NB: Using deprecated connect() until Rust 1.3 becomes stable. let string = free.join(" ");
let string = free.connect(" ");
if options.escape { if options.escape {
let mut prev_was_slash = false; let mut prev_was_slash = false;
let mut iter = string.chars().enumerate(); let mut iter = string.chars().enumerate();

View file

@ -153,7 +153,7 @@ fn fold_file<T: Read>(mut file: BufReader<T>, bytes: bool, spaces: bool, width:
match rfind_whitespace(slice) { match rfind_whitespace(slice) {
Some(m) => { Some(m) => {
let routput = &slice[m + 1 .. slice.chars().count()]; 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 { out + match ch {
'\t' => 8, '\t' => 8,
'\x08' => if out > 0 { -1 } else { 0 }, '\x08' => if out > 0 { -1 } else { 0 },

View file

@ -420,9 +420,7 @@ fn adjust_tex_str(context: &str) -> String {
let ws_reg = Regex::new(r"[\t\n\v\f\r ]").unwrap(); 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 mut fix: String = ws_reg.replace_all(context, " ").trim().to_string();
let mapped_chunks: Vec<String> = fix.chars().map(tex_mapper).collect(); let mapped_chunks: Vec<String> = fix.chars().map(tex_mapper).collect();
// NB: Using deprecated connect() until Rust 1.3 becomes stable. fix = mapped_chunks.join("");
// When 1.3 is released, replace connect() with join().
fix = mapped_chunks.connect("");
fix fix
} }

View file

@ -1,6 +1,5 @@
#![crate_name = "libstdbuf"] #![crate_name = "libstdbuf"]
#![crate_type = "staticlib"] #![crate_type = "staticlib"]
#![feature(libc)]
extern crate libc; extern crate libc;

View file

@ -1,5 +1,4 @@
#![crate_name = "stdbuf"] #![crate_name = "stdbuf"]
#![feature(negate_unsigned)]
/* /*
* This file is part of the uutils coreutils package. * This file is part of the uutils coreutils package.

View file

@ -1,5 +1,4 @@
#![crate_name = "timeout"] #![crate_name = "timeout"]
#![feature(process_id)]
/* /*
* This file is part of the uutils coreutils package. * This file is part of the uutils coreutils package.

View file

@ -117,7 +117,6 @@ fn exec(filename: &str) {
if users.len() > 0 { if users.len() > 0 {
users.sort(); users.sort();
// NB: Using deprecated connect() until Rust 1.3 becomes stable. println!("{}", users.join(" "));
println!("{}", users.connect(" "));
} }
} }

View file

@ -50,8 +50,7 @@ pub fn uumain(args: Vec<String>) -> i32 {
let string = if matches.free.is_empty() { let string = if matches.free.is_empty() {
"y".to_string() "y".to_string()
} else { } else {
// NB: Using deprecated connect() until Rust 1.3 becomes stable. matches.free.join(" ")
matches.free.connect(" ")
}; };
exec(&string[..]); exec(&string[..]);