Demode extfmt
Needs a snapshot before this can be completed, because I changed the mode for conv_poly.
This commit is contained in:
parent
21519bc7e0
commit
2f4ee89119
10 changed files with 117 additions and 105 deletions
|
@ -156,14 +156,14 @@ mod v4 {
|
|||
fn parse_to_ipv4_rep(ip: &str) -> result::Result<Ipv4Rep, ~str> {
|
||||
let parts = vec::map(str::split_char(ip, '.'), |s| {
|
||||
match uint::from_str(*s) {
|
||||
Some(n) if n <= 255u => n,
|
||||
_ => 256u
|
||||
Some(n) if n <= 255 => n,
|
||||
_ => 256
|
||||
}
|
||||
});
|
||||
if vec::len(parts) != 4u {
|
||||
if parts.len() != 4 {
|
||||
result::Err(fmt!("'%s' doesn't have 4 parts", ip))
|
||||
}
|
||||
else if vec::contains(parts, &256u) {
|
||||
else if parts.contains(&256) {
|
||||
result::Err(fmt!("invalid octal in addr '%s'", ip))
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue