mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-01 05:27:45 +00:00
Merge pull request #468 from Arcterus/fix-build
Fix build for latest Rust
This commit is contained in:
commit
baa7eccd4d
6 changed files with 13 additions and 12 deletions
|
@ -14,7 +14,7 @@ extern crate getopts;
|
||||||
use std::cmp::Ord;
|
use std::cmp::Ord;
|
||||||
use std::io::{BufferedReader, IoResult, print};
|
use std::io::{BufferedReader, IoResult, print};
|
||||||
use std::io::fs::File;
|
use std::io::fs::File;
|
||||||
use std::io::stdio::{stdin, StdReader};
|
use std::io::stdio::{stdin, StdinReader};
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
static NAME : &'static str = "comm";
|
static NAME : &'static str = "comm";
|
||||||
|
@ -45,7 +45,7 @@ fn ensure_nl(line: String) -> String {
|
||||||
}
|
}
|
||||||
|
|
||||||
enum LineReader {
|
enum LineReader {
|
||||||
Stdin(BufferedReader<StdReader>),
|
Stdin(StdinReader),
|
||||||
FileIn(BufferedReader<File>)
|
FileIn(BufferedReader<File>)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,8 +13,9 @@
|
||||||
extern crate getopts;
|
extern crate getopts;
|
||||||
extern crate libc;
|
extern crate libc;
|
||||||
|
|
||||||
use std::vec::{Vec};
|
use std::vec::Vec;
|
||||||
use std::io::{stdin};
|
use std::io::BufferedReader;
|
||||||
|
use std::io::stdio::stdin_raw;
|
||||||
|
|
||||||
#[path="../common/util.rs"]
|
#[path="../common/util.rs"]
|
||||||
mod util;
|
mod util;
|
||||||
|
@ -91,7 +92,7 @@ pub fn uumain(args: Vec<String>) -> int {
|
||||||
}
|
}
|
||||||
|
|
||||||
if matches.free.is_empty() {
|
if matches.free.is_empty() {
|
||||||
for line in stdin().lines() {
|
for line in BufferedReader::new(stdin_raw()).lines() {
|
||||||
print_factors_str(line.unwrap().as_slice().trim());
|
print_factors_str(line.unwrap().as_slice().trim());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
* that was distributed with this source code.
|
* that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#![feature(macro_rules, if_let)]
|
#![feature(macro_rules)]
|
||||||
|
|
||||||
extern crate getopts;
|
extern crate getopts;
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#![feature(if_let, macro_rules)]
|
#![feature(macro_rules)]
|
||||||
|
|
||||||
extern crate getopts;
|
extern crate getopts;
|
||||||
extern crate libc;
|
extern crate libc;
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#![feature(if_let, macro_rules)]
|
#![feature(macro_rules)]
|
||||||
|
|
||||||
extern crate getopts;
|
extern crate getopts;
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,8 @@ extern crate getopts;
|
||||||
use getopts::OptGroup;
|
use getopts::OptGroup;
|
||||||
use std::char::from_u32;
|
use std::char::from_u32;
|
||||||
use std::collections::{BitvSet, VecMap};
|
use std::collections::{BitvSet, VecMap};
|
||||||
use std::io::print;
|
use std::io::{BufferedReader, print};
|
||||||
use std::io::stdio::{stdin,stdout};
|
use std::io::stdio::{stdin_raw, stdout};
|
||||||
use std::iter::FromIterator;
|
use std::iter::FromIterator;
|
||||||
use std::vec::Vec;
|
use std::vec::Vec;
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ fn delete(set: Vec<char>, complement: bool) {
|
||||||
|c: char| !bset.contains(&(c as uint))
|
|c: char| !bset.contains(&(c as uint))
|
||||||
};
|
};
|
||||||
|
|
||||||
for c in stdin().chars() {
|
for c in BufferedReader::new(stdin_raw()).chars() {
|
||||||
match c {
|
match c {
|
||||||
Ok(c) if is_allowed(c) => out.write_char(c).unwrap(),
|
Ok(c) if is_allowed(c) => out.write_char(c).unwrap(),
|
||||||
Ok(_) => (),
|
Ok(_) => (),
|
||||||
|
@ -126,7 +126,7 @@ fn tr(set1: &[char], set2: &[char]) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for c in stdin().chars() {
|
for c in BufferedReader::new(stdin_raw()).chars() {
|
||||||
match c {
|
match c {
|
||||||
Ok(inc) => {
|
Ok(inc) => {
|
||||||
let trc = match map.get(&(inc as uint)) {
|
let trc = match map.get(&(inc as uint)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue