Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
The issue was the failure in converting &str to KafkaOffset.
Just perform lowercase conversion...

Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.4326@gmail.com>
  • Loading branch information
hbina authored and JakkuSakura committed Mar 21, 2021
1 parent 45c3539 commit fb66688
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/configs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const GROUP_ID_DEFAULT: &str = "kafcat";
const BROKERS_DEFAULT: &str = "localhost:9092";
const MSG_DELIMITER_DEFAULT: &str = "\n";
const KEY_DELIMITER_DEFAULT: &str = ":";
const OFFSET_DEFAULT: &str = "Beginning";
const OFFSET_DEFAULT: &str = "beginning";
const FORMAT_DEFAULT: &str = "text";

pub fn group_id() -> Arg<'static> {
Expand Down Expand Up @@ -155,7 +155,7 @@ impl FromStr for KafkaOffset {
type Err = String;

fn from_str(value: &str) -> Result<Self, String> {
Ok(match value {
Ok(match value.to_ascii_lowercase().as_str() {
"beginning" => KafkaOffset::Beginning,
"end" => KafkaOffset::End,
"stored" => KafkaOffset::Stored,
Expand Down

0 comments on commit fb66688

Please sign in to comment.