Changes to stable APIs towards Rust 1.0

This commit is contained in:
Kevin K 2015-03-18 08:41:09 -04:00
parent c82bb523ab
commit 399ad97413
2 changed files with 5 additions and 5 deletions

View file

@ -447,7 +447,7 @@ impl App {
}
fn parse_long_arg(&mut self, matches: &mut ArgMatches ,full_arg: &String) -> Option<&'static str> {
let mut arg = full_arg.as_slice().trim_left_matches(|c| c == '-');
let mut arg = full_arg.trim_left_matches(|c| c == '-');
let mut found = false;
if arg == "help" && self.needs_long_help {
@ -547,7 +547,7 @@ impl App {
}
fn parse_short_arg(&mut self, matches: &mut ArgMatches ,full_arg: &String) -> Option<&'static str> {
let arg = full_arg.as_slice().trim_left_matches(|c| c == '-');
let arg = &full_arg[..].trim_left_matches(|c| c == '-');
if arg.len() > 1 {
// Multiple flags using short i.e. -bgHlS
for c in arg.chars() {
@ -708,7 +708,7 @@ impl App {
let mut needs_val_of: Option<&'static str> = None;
let mut pos_counter = 1;
while let Some(arg) = it.next() {
let arg_slice = arg.as_slice();
let arg_slice = &arg[..];
let mut skip = false;
if ! pos_only {
if let Some(nvo) = needs_val_of {
@ -869,4 +869,4 @@ impl App {
matches
}
}
}

View file

@ -1,6 +1,6 @@
#![crate_type= "lib"]
#![feature(collections, core, libc, exit_status)]
#![feature(collections, libc, exit_status)]
//! A simply library for parsing command line arguments when writing
//! command line and console applications.