Skip to content

Commit

Permalink
Use byte literals in libgetopts
Browse files Browse the repository at this point in the history
  • Loading branch information
nham committed Aug 6, 2014
1 parent efdb77b commit 96d1712
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libgetopts/lib.rs
Expand Up @@ -372,7 +372,7 @@ impl Matches {
}

fn is_arg(arg: &str) -> bool {
arg.len() > 1 && arg.as_bytes()[0] == '-' as u8
arg.len() > 1 && arg.as_bytes()[0] == b'-'
}

fn find_opt(opts: &[Opt], nm: Name) -> Option<uint> {
Expand Down Expand Up @@ -555,7 +555,7 @@ pub fn getopts(args: &[String], optgrps: &[OptGroup]) -> Result {
} else {
let mut names;
let mut i_arg = None;
if cur.as_bytes()[1] == '-' as u8 {
if cur.as_bytes()[1] == b'-' {
let tail = cur.as_slice().slice(2, curlen);
let tail_eq: Vec<&str> = tail.split('=').collect();
if tail_eq.len() <= 1 {
Expand Down

5 comments on commit 96d1712

@bors
Copy link
Contributor

@bors bors commented on 96d1712 Aug 6, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from alexcrichton
at nham@96d1712

@bors
Copy link
Contributor

@bors bors commented on 96d1712 Aug 6, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging nham/rust/byte_literals = 96d1712 into auto

@bors
Copy link
Contributor

@bors bors commented on 96d1712 Aug 6, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nham/rust/byte_literals = 96d1712 merged ok, testing candidate = 8fe73f1

@bors
Copy link
Contributor

@bors bors commented on 96d1712 Aug 7, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 8fe73f1

Please sign in to comment.