mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-30 20:47:46 +00:00
update from string for new api
This commit is contained in:
parent
1cdab45c1b
commit
737db500a3
8 changed files with 10 additions and 10 deletions
|
@ -28,7 +28,7 @@ pub fn from_str(string: &str) -> Result<f64, String> {
|
|||
}
|
||||
}
|
||||
};
|
||||
match ::std::from_str::from_str::<f64>(numstr) {
|
||||
match ::std::str::from_str::<f64>(numstr) {
|
||||
Some(m) => Ok(m * times as f64),
|
||||
None => Err(format!("invalid time interval '{}'", string))
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ pub struct Range {
|
|||
pub high: uint,
|
||||
}
|
||||
|
||||
impl std::from_str::FromStr for Range {
|
||||
impl std::str::FromStr for Range {
|
||||
fn from_str(s: &str) -> Option<Range> {
|
||||
use std::uint::MAX;
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ extern crate getopts;
|
|||
extern crate libc;
|
||||
|
||||
use std::io;
|
||||
use std::from_str;
|
||||
use std::str::from_str;
|
||||
|
||||
#[path = "../common/util.rs"]
|
||||
mod util;
|
||||
|
@ -29,7 +29,7 @@ fn tabstops_parse(s: String) -> Vec<uint> {
|
|||
let words = s.as_slice().split(',').collect::<Vec<&str>>();
|
||||
|
||||
let nums = words.into_iter()
|
||||
.map(|sn| from_str::from_str::<uint>(sn)
|
||||
.map(|sn| from_str::<uint>(sn)
|
||||
.unwrap_or_else(
|
||||
|| crash!(1, "{}\n", "tab size contains invalid character(s)"))
|
||||
)
|
||||
|
|
|
@ -19,7 +19,7 @@ extern crate serialize;
|
|||
|
||||
#[phase(plugin, link)] extern crate log;
|
||||
|
||||
use std::from_str::from_str;
|
||||
use std::str::from_str;
|
||||
use std::io::process::Process;
|
||||
|
||||
use getopts::{
|
||||
|
|
|
@ -15,7 +15,7 @@ extern crate getopts;
|
|||
extern crate libc;
|
||||
|
||||
use std::cmp;
|
||||
use std::from_str::from_str;
|
||||
use std::str::from_str;
|
||||
use std::io;
|
||||
use std::io::IoResult;
|
||||
use std::iter::{range_inclusive, RangeInclusive};
|
||||
|
|
|
@ -15,7 +15,7 @@ extern crate getopts;
|
|||
extern crate libc;
|
||||
|
||||
use std::io;
|
||||
use std::from_str;
|
||||
use std::str::from_str;
|
||||
|
||||
#[path = "../common/util.rs"]
|
||||
mod util;
|
||||
|
@ -29,7 +29,7 @@ fn tabstops_parse(s: String) -> Vec<uint> {
|
|||
let words = s.as_slice().split(',').collect::<Vec<&str>>();
|
||||
|
||||
let nums = words.into_iter()
|
||||
.map(|sn| from_str::from_str::<uint>(sn)
|
||||
.map(|sn| from_str::<uint>(sn)
|
||||
.unwrap_or_else(
|
||||
|| crash!(1, "{}\n", "tab size contains invalid character(s)"))
|
||||
)
|
||||
|
|
|
@ -15,7 +15,7 @@ extern crate getopts;
|
|||
|
||||
use std::ascii::OwnedAsciiExt;
|
||||
use std::cmp::min;
|
||||
use std::from_str::FromStr;
|
||||
use std::str::FromStr;
|
||||
use std::io;
|
||||
|
||||
#[path = "../common/util.rs"]
|
||||
|
|
|
@ -20,7 +20,7 @@ extern crate libc;
|
|||
use std::mem::transmute;
|
||||
use std::io::{print, File};
|
||||
use std::ptr::{null_mut, null};
|
||||
use std::from_str::from_str;
|
||||
use std::str::from_str;
|
||||
use libc::{time_t, c_double, c_int, c_char};
|
||||
use c_types::c_tm;
|
||||
use utmpx::*;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue