mirror of
https://github.com/uutils/coreutils
synced 2024-11-17 02:08:09 +00:00
Merge pull request #187 from ebfe/fix-deprecation
Fix deprecation warnings
This commit is contained in:
commit
67f2599d5a
2 changed files with 4 additions and 4 deletions
|
@ -185,8 +185,8 @@ fn parse_size(size: &str) -> (u64, TruncateMode) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if size.char_at(size.len() - 1).is_alphabetic() {
|
if size.char_at(size.len() - 1).is_alphabetic() {
|
||||||
number *= match size.char_at(size.len() - 1).to_ascii().to_upper().to_char() {
|
number *= match size.char_at(size.len() - 1).to_ascii().to_uppercase().to_char() {
|
||||||
'B' => match size.char_at(size.len() - 2).to_ascii().to_upper().to_char() {
|
'B' => match size.char_at(size.len() - 2).to_ascii().to_uppercase().to_char() {
|
||||||
'K' => 1000,
|
'K' => 1000,
|
||||||
'M' => 1000 * 1000,
|
'M' => 1000 * 1000,
|
||||||
'G' => 1000 * 1000 * 1000,
|
'G' => 1000 * 1000 * 1000,
|
||||||
|
|
|
@ -18,7 +18,7 @@ extern crate getopts;
|
||||||
extern crate libc;
|
extern crate libc;
|
||||||
|
|
||||||
use std::os;
|
use std::os;
|
||||||
use std::mem::uninit;
|
use std::mem::uninitialized;
|
||||||
use std::io::print;
|
use std::io::print;
|
||||||
use std::str::raw::from_c_str;
|
use std::str::raw::from_c_str;
|
||||||
use c_types::utsname;
|
use c_types::utsname;
|
||||||
|
@ -39,7 +39,7 @@ extern {
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe fn getuname() -> utsrust {
|
unsafe fn getuname() -> utsrust {
|
||||||
let mut uts: utsname = uninit();
|
let mut uts: utsname = uninitialized();
|
||||||
uname(&mut uts);
|
uname(&mut uts);
|
||||||
utsrust {
|
utsrust {
|
||||||
sysname: from_c_str(uts.sysname.as_ptr()), nodename: from_c_str(uts.nodename.as_ptr()),
|
sysname: from_c_str(uts.sysname.as_ptr()), nodename: from_c_str(uts.nodename.as_ptr()),
|
||||||
|
|
Loading…
Reference in a new issue