mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-12-27 16:07:46 +00:00
rename PostcardNew to bidirectional-postcard-prototype
This commit is contained in:
parent
a79fa074fe
commit
2c71fa8cd4
@ -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}")),
|
||||
}
|
||||
}
|
||||
|
||||
@ -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>(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user