diff options
author | Richard Walters <rwalters@digitalstirling.com> | 2020-10-12 14:15:59 -0700 |
---|---|---|
committer | Richard Walters <rwalters@digitalstirling.com> | 2020-10-12 14:15:59 -0700 |
commit | cf3d28248a036e7544cf899fd6f658d2863d4ec8 (patch) | |
tree | 27ef2b914cbfceb585829b4b0f042d49b907ebc9 /src | |
parent | c884ece8f383febd87bda3e45060f189502c3c2b (diff) |
clean up todos
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -17,7 +17,7 @@ use std::convert::TryFrom; // This is the character set containing just the alphabetic characters // from the ASCII character set. // -// TODO: improvement +// TODO: consider improvement // [14:49] silmeth: @rhymu8354 you might want to look at once_cell as a nicer // macro-less replacement for lazystatic!() lazy_static! { @@ -271,10 +271,7 @@ fn validate_ipv4_address(address: &str) -> Result<(), Error> { let mut num_groups = 0; let mut state = State::NotInOctet; let mut octet_buffer = String::new(); - // TODO: consider improvements - // - // [15:29] silen_z: one cool thing you could consider using (even in - // the previous function) is matching on tuple of (state, character) + // TODO: consider improvement // // Validation of the octet_buffer is done in two places; consider // how to remove the redundant code. @@ -291,8 +288,6 @@ fn validate_ipv4_address(address: &str) -> Result<(), Error> { State::ExpectDigitOrDot if c == '.' => { num_groups += 1; - // TODO: explore combining these two "if" statements or - // expressing them in a better way. if num_groups > 4 { return Err(Error::TooManyAddressParts); } |