mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-31 21:17:46 +00:00
Merge pull request #478 from lht/fix-build-master-62fb41c32
Fix build master rustc @62fb41c32
This commit is contained in:
commit
710f41c375
9 changed files with 13 additions and 13 deletions
2
deps/rust-crypto
vendored
2
deps/rust-crypto
vendored
|
@ -1 +1 @@
|
|||
Subproject commit baa0874a75fcb76eeb6a7e430f02aaaf4e4b2701
|
||||
Subproject commit 3db4f22536d9391b1eebadbe868593d44a6295ae
|
|
@ -40,7 +40,7 @@ fn main() {
|
|||
}
|
||||
_ => {
|
||||
crates.push_str(format!("extern crate {};\n", prog).as_slice());
|
||||
util_map.push_str(format!("map.insert(\"{prog}\", {prog}::uumain);\n", prog = prog).as_slice());
|
||||
util_map.push_str(format!("map.insert(\"{prog}\", {prog}::uumain as fn(Vec<String>) -> int);\n", prog = prog).as_slice());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ directory).", &opts).as_slice());
|
|||
for path in matches.free.iter() {
|
||||
let p = std::path::Path::new(path.clone());
|
||||
let d = std::str::from_utf8(p.dirname());
|
||||
if d.is_some() {
|
||||
if d.is_ok() {
|
||||
print(d.unwrap());
|
||||
}
|
||||
print(separator);
|
||||
|
|
|
@ -194,7 +194,7 @@ ers of 1000).",
|
|||
let summarize = matches.opt_present("summarize");
|
||||
|
||||
let max_depth_str = matches.opt_str("max-depth");
|
||||
let max_depth = max_depth_str.as_ref().and_then(|s| from_str::<uint>(s.as_slice()));
|
||||
let max_depth = max_depth_str.as_ref().and_then(|s| s.parse::<uint>());
|
||||
match (max_depth_str, max_depth) {
|
||||
(Some(ref s), _) if summarize => {
|
||||
show_error!("summarizing conflicts with --max-depth={}", *s);
|
||||
|
@ -246,7 +246,7 @@ ers of 1000).",
|
|||
letters.push(c);
|
||||
}
|
||||
}
|
||||
let number = from_utf8(numbers.as_slice()).and_then(from_str::<uint>).unwrap();
|
||||
let number = from_utf8(numbers.as_slice()).ok().unwrap().parse::<uint>().unwrap();
|
||||
let multiple = match String::from_chars(letters.as_slice()).as_slice() {
|
||||
"K" => 1024, "M" => 1024 * 1024, "G" => 1024 * 1024 * 1024,
|
||||
"T" => 1024 * 1024 * 1024 * 1024, "P" => 1024 * 1024 * 1024 * 1024 * 1024,
|
||||
|
|
|
@ -53,7 +53,7 @@ fn isodigit(c: u8) -> bool {
|
|||
}
|
||||
|
||||
fn convert_str(string: &[u8], index: uint, base: uint) -> (char, uint) {
|
||||
let (max_digits, is_legal_digit) = match base {
|
||||
let (max_digits, is_legal_digit) : (uint, fn(u8) -> bool) = match base {
|
||||
8u => (3, isodigit),
|
||||
16u => (2, isxdigit),
|
||||
_ => panic!(),
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
use core::iter::Peekable;
|
||||
use std::io::Lines;
|
||||
use std::slice::Items;
|
||||
use std::slice::Iter;
|
||||
use std::str::CharRange;
|
||||
use FileOrStdReader;
|
||||
use FmtOptions;
|
||||
|
@ -440,7 +440,7 @@ impl<'a> ParaWords<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn words(&'a self) -> Items<'a, WordInfo<'a>> { return self.words.iter() }
|
||||
pub fn words(&'a self) -> Iter<'a, WordInfo<'a>> { return self.words.iter() }
|
||||
}
|
||||
|
||||
struct WordSplit<'a> {
|
||||
|
|
|
@ -176,7 +176,7 @@ fn nl<T: Reader> (reader: &mut BufferedReader<T>, settings: &Settings) {
|
|||
NumberingStyle::NumberForRegularExpression(ref re) => re,
|
||||
_ => REGEX_DUMMY,
|
||||
};
|
||||
let mut line_filter = pass_regex;
|
||||
let mut line_filter : fn(&str, ®ex::Regex) -> bool = pass_regex;
|
||||
for mut l in reader.lines().map(|r| r.unwrap()) {
|
||||
// Sanitize the string. We want to print the newline ourselves.
|
||||
if l.as_slice().chars().rev().next().unwrap() == '\n' {
|
||||
|
|
|
@ -121,7 +121,7 @@ enum IntegerCondition {
|
|||
|
||||
fn integers(a: &[u8], b: &[u8], cond: IntegerCondition) -> bool {
|
||||
let (a, b): (&str, &str) = match (from_utf8(a), from_utf8(b)) {
|
||||
(Some(a), Some(b)) => (a, b),
|
||||
(Ok(a), Ok(b)) => (a, b),
|
||||
_ => return false,
|
||||
};
|
||||
let (a, b): (i64, i64) = match (from_str(a), from_str(b)) {
|
||||
|
@ -140,7 +140,7 @@ fn integers(a: &[u8], b: &[u8], cond: IntegerCondition) -> bool {
|
|||
|
||||
fn isatty(fd: &[u8]) -> bool {
|
||||
use libc::{isatty};
|
||||
from_utf8(fd).and_then(|s| from_str(s))
|
||||
from_utf8(fd).ok().and_then(|s| from_str(s))
|
||||
.map(|i| unsafe { isatty(i) == 1 }).unwrap_or(false)
|
||||
}
|
||||
|
||||
|
|
|
@ -128,12 +128,12 @@ pub fn wc(files: Vec<String>, matches: &Matches) -> StdResult<(), int> {
|
|||
|
||||
// try and convert the bytes to UTF-8 first
|
||||
match from_utf8(raw_line.as_slice()) {
|
||||
Some(line) => {
|
||||
Ok(line) => {
|
||||
word_count += line.words().count();
|
||||
current_char_count = line.char_len();
|
||||
char_count += current_char_count;
|
||||
},
|
||||
None => {
|
||||
Err(..) => {
|
||||
word_count += raw_line.as_slice().split(|&x| is_word_seperator(x)).count();
|
||||
for byte in raw_line.iter() {
|
||||
match byte.is_ascii() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue