Unnamed repository; edit this file 'description' to name the repository.
minor: Rename proc-macro-srv protocol flags
Lukas Wirth 5 months ago
parent 00e1a83 · commit 82bd7dd
-rw-r--r--crates/proc-macro-api/src/process.rs4
-rw-r--r--crates/proc-macro-srv-cli/src/main.rs18
2 files changed, 12 insertions, 10 deletions
diff --git a/crates/proc-macro-api/src/process.rs b/crates/proc-macro-api/src/process.rs
index 1365245f98..7bddb940e2 100644
--- a/crates/proc-macro-api/src/process.rs
+++ b/crates/proc-macro-api/src/process.rs
@@ -274,9 +274,9 @@ fn mk_child<'a>(
#[allow(clippy::disallowed_methods)]
let mut cmd = Command::new(path);
if matches!(protocol, Protocol::LegacyJson { .. }) {
- cmd.args(["--format", "json"]);
+ cmd.args(["--format", "json-legacy"]);
} else {
- cmd.args(["--format", "postcard"]);
+ cmd.args(["--format", "postcard-legacy"]);
}
for env in extra_env {
match env {
diff --git a/crates/proc-macro-srv-cli/src/main.rs b/crates/proc-macro-srv-cli/src/main.rs
index b6c38da454..813ac339a9 100644
--- a/crates/proc-macro-srv-cli/src/main.rs
+++ b/crates/proc-macro-srv-cli/src/main.rs
@@ -31,7 +31,7 @@ fn main() -> std::io::Result<()> {
clap::Arg::new("format")
.long("format")
.action(clap::ArgAction::Set)
- .default_value("json")
+ .default_value("json-legacy")
.value_parser(clap::builder::EnumValueParser::<ProtocolFormat>::new()),
clap::Arg::new("version")
.long("version")
@@ -50,25 +50,27 @@ fn main() -> std::io::Result<()> {
#[derive(Copy, Clone)]
enum ProtocolFormat {
- Json,
- Postcard,
+ JsonLegacy,
+ PostcardLegacy,
}
impl ValueEnum for ProtocolFormat {
fn value_variants<'a>() -> &'a [Self] {
- &[ProtocolFormat::Json, ProtocolFormat::Postcard]
+ &[ProtocolFormat::JsonLegacy, ProtocolFormat::PostcardLegacy]
}
fn to_possible_value(&self) -> Option<clap::builder::PossibleValue> {
match self {
- ProtocolFormat::Json => Some(clap::builder::PossibleValue::new("json")),
- ProtocolFormat::Postcard => Some(clap::builder::PossibleValue::new("postcard")),
+ ProtocolFormat::JsonLegacy => Some(clap::builder::PossibleValue::new("json-legacy")),
+ ProtocolFormat::PostcardLegacy => {
+ Some(clap::builder::PossibleValue::new("postcard-legacy"))
+ }
}
}
fn from_str(input: &str, _ignore_case: bool) -> Result<Self, String> {
match input {
- "json" => Ok(ProtocolFormat::Json),
- "postcard" => Ok(ProtocolFormat::Postcard),
+ "json-legacy" => Ok(ProtocolFormat::JsonLegacy),
+ "postcard-legacy" => Ok(ProtocolFormat::PostcardLegacy),
_ => Err(format!("unknown protocol format: {input}")),
}
}