rename PostcardNew to bidirectional-postcard-prototype

This commit is contained in:
bit-aloo 2025-12-22 20:56:16 +05:30
parent a79fa074fe
commit 2c71fa8cd4
No known key found for this signature in database
2 changed files with 6 additions and 6 deletions

View File

@ -31,7 +31,7 @@ fn main() -> std::io::Result<()> {
clap::Arg::new("format")
.long("format")
.action(clap::ArgAction::Set)
.default_value("postcard-new")
.default_value("bidirectional-postcard-prototype")
.value_parser(clap::builder::EnumValueParser::<ProtocolFormat>::new()),
clap::Arg::new("version")
.long("version")
@ -52,12 +52,12 @@ fn main() -> std::io::Result<()> {
enum ProtocolFormat {
JsonLegacy,
PostcardLegacy,
PostcardNew,
BidirectionalPostcardPrototype,
}
impl ValueEnum for ProtocolFormat {
fn value_variants<'a>() -> &'a [Self] {
&[ProtocolFormat::JsonLegacy, ProtocolFormat::PostcardLegacy, ProtocolFormat::PostcardNew]
&[ProtocolFormat::JsonLegacy, ProtocolFormat::PostcardLegacy, ProtocolFormat::BidirectionalPostcardPrototype]
}
fn to_possible_value(&self) -> Option<clap::builder::PossibleValue> {
@ -66,14 +66,14 @@ impl ValueEnum for ProtocolFormat {
ProtocolFormat::PostcardLegacy => {
Some(clap::builder::PossibleValue::new("postcard-legacy"))
}
ProtocolFormat::PostcardNew => Some(clap::builder::PossibleValue::new("postcard-new")),
ProtocolFormat::BidirectionalPostcardPrototype => Some(clap::builder::PossibleValue::new("postcard-new")),
}
}
fn from_str(input: &str, _ignore_case: bool) -> Result<Self, String> {
match input {
"json-legacy" => Ok(ProtocolFormat::JsonLegacy),
"postcard-legacy" => Ok(ProtocolFormat::PostcardLegacy),
"postcard-new" => Ok(ProtocolFormat::PostcardNew),
"bidirectional-postcard-prototype" => Ok(ProtocolFormat::BidirectionalPostcardPrototype),
_ => Err(format!("unknown protocol format: {input}")),
}
}

View File

@ -38,7 +38,7 @@ pub(crate) fn run(format: ProtocolFormat) -> io::Result<()> {
match format {
ProtocolFormat::JsonLegacy => run_::<JsonProtocol>(),
ProtocolFormat::PostcardLegacy => run_::<PostcardProtocol>(),
ProtocolFormat::PostcardNew => run_new::<PostcardProtocol>(),
ProtocolFormat::BidirectionalPostcardPrototype => run_new::<PostcardProtocol>(),
}
}