diff options
Diffstat (limited to 'src/libgetopts/lib.rs')
| -rw-r--r-- | src/libgetopts/lib.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/libgetopts/lib.rs b/src/libgetopts/lib.rs index 884f4490d9f..eda20699755 100644 --- a/src/libgetopts/lib.rs +++ b/src/libgetopts/lib.rs @@ -91,7 +91,6 @@ #![deny(missing_docs)] #![feature(staged_api)] -#![feature(str_char)] use self::Name::*; use self::HasArg::*; @@ -223,7 +222,7 @@ pub type Result = result::Result<Matches, Fail>; impl Name { fn from_str(nm: &str) -> Name { if nm.len() == 1 { - Short(nm.char_at(0)) + Short(nm.chars().next().unwrap()) } else { Long(nm.to_owned()) } @@ -261,7 +260,7 @@ impl OptGroup { } (1, 0) => { Opt { - name: Short(short_name.char_at(0)), + name: Short(short_name.chars().next().unwrap()), hasarg: hasarg, occur: occur, aliases: Vec::new(), @@ -273,7 +272,7 @@ impl OptGroup { hasarg: hasarg, occur: occur, aliases: vec![Opt { - name: Short(short_name.char_at(0)), + name: Short(short_name.chars().next().unwrap()), hasarg: hasarg, occur: occur, aliases: Vec::new(), @@ -599,7 +598,7 @@ pub fn getopts(args: &[String], optgrps: &[OptGroup]) -> Result { let mut j = 1; names = Vec::new(); while j < curlen { - let ch = cur.char_at(j); + let ch = cur[j..].chars().next().unwrap(); let opt = Short(ch); // In a series of potential options (eg. -aheJ), if we |
