Skip to content

Commit

Permalink
Merge pull request #8 from faradayio/allow-match-enhanced
Browse files Browse the repository at this point in the history
allow --match enhanced
  • Loading branch information
emk authored Dec 13, 2021
2 parents 243bdda + fe5f69d commit 6f5b414
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ use crate::structure::Structure;
#[structopt(about = "geocode CSV files passed on standard input")]
struct Opt {
/// `strict` for valid postal addresses only, `range` for unknown addresses
/// within a street's known range, and `invalid` to always generate some
/// match.
/// within a street's known range, `invalid` to always generate some
/// match, and `enhanced` if you've paid for it.
#[structopt(long = "match", default_value = "strict")]
match_strategy: MatchStrategy,

Expand Down
3 changes: 3 additions & 0 deletions src/smartystreets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ pub enum MatchStrategy {
Range,
/// Return a candidate for every address.
Invalid,
/// Use "enhanced" matching (which you pay extra for)
Enhanced,
}

impl Default for MatchStrategy {
Expand All @@ -69,6 +71,7 @@ impl FromStr for MatchStrategy {
"strict" => Ok(MatchStrategy::Strict),
"range" => Ok(MatchStrategy::Range),
"invalid" => Ok(MatchStrategy::Invalid),
"enhanced" => Ok(MatchStrategy::Enhanced),
_ => Err(format_err!("unknown match strategy {:?}", s)),
}
}
Expand Down

0 comments on commit 6f5b414

Please sign in to comment.