Skip to content

Commit

Permalink
utils: fix FromStr implementation for Protocol enum
Browse files Browse the repository at this point in the history
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
  • Loading branch information
rwestphal committed Nov 8, 2023
1 parent b5b5fe7 commit 521975f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion holo-utils/src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,13 @@ impl FromStr for Protocol {
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s.to_lowercase().as_ref() {
"bfd" => Ok(Protocol::BFD),
"static" => Ok(Protocol::STATIC),
"direct" => Ok(Protocol::DIRECT),
"ldp" => Ok(Protocol::LDP),
"ospfv2" => Ok(Protocol::OSPFV2),
"ospfv3" => Ok(Protocol::OSPFV3),
"ripv2" => Ok(Protocol::RIPV2),
"ripng" => Ok(Protocol::RIPNG),
"static" => Ok(Protocol::STATIC),
_ => Err(()),
}
}
Expand Down

0 comments on commit 521975f

Please sign in to comment.