Skip to content

Commit 82bd7dd

Browse files
committed
minor: Rename proc-macro-srv protocol flags
1 parent 00e1a83 commit 82bd7dd

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

crates/proc-macro-api/src/process.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,9 @@ fn mk_child<'a>(
274274
#[allow(clippy::disallowed_methods)]
275275
let mut cmd = Command::new(path);
276276
if matches!(protocol, Protocol::LegacyJson { .. }) {
277-
cmd.args(["--format", "json"]);
277+
cmd.args(["--format", "json-legacy"]);
278278
} else {
279-
cmd.args(["--format", "postcard"]);
279+
cmd.args(["--format", "postcard-legacy"]);
280280
}
281281
for env in extra_env {
282282
match env {

crates/proc-macro-srv-cli/src/main.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ fn main() -> std::io::Result<()> {
3131
clap::Arg::new("format")
3232
.long("format")
3333
.action(clap::ArgAction::Set)
34-
.default_value("json")
34+
.default_value("json-legacy")
3535
.value_parser(clap::builder::EnumValueParser::<ProtocolFormat>::new()),
3636
clap::Arg::new("version")
3737
.long("version")
@@ -50,25 +50,27 @@ fn main() -> std::io::Result<()> {
5050

5151
#[derive(Copy, Clone)]
5252
enum ProtocolFormat {
53-
Json,
54-
Postcard,
53+
JsonLegacy,
54+
PostcardLegacy,
5555
}
5656

5757
impl ValueEnum for ProtocolFormat {
5858
fn value_variants<'a>() -> &'a [Self] {
59-
&[ProtocolFormat::Json, ProtocolFormat::Postcard]
59+
&[ProtocolFormat::JsonLegacy, ProtocolFormat::PostcardLegacy]
6060
}
6161

6262
fn to_possible_value(&self) -> Option<clap::builder::PossibleValue> {
6363
match self {
64-
ProtocolFormat::Json => Some(clap::builder::PossibleValue::new("json")),
65-
ProtocolFormat::Postcard => Some(clap::builder::PossibleValue::new("postcard")),
64+
ProtocolFormat::JsonLegacy => Some(clap::builder::PossibleValue::new("json-legacy")),
65+
ProtocolFormat::PostcardLegacy => {
66+
Some(clap::builder::PossibleValue::new("postcard-legacy"))
67+
}
6668
}
6769
}
6870
fn from_str(input: &str, _ignore_case: bool) -> Result<Self, String> {
6971
match input {
70-
"json" => Ok(ProtocolFormat::Json),
71-
"postcard" => Ok(ProtocolFormat::Postcard),
72+
"json-legacy" => Ok(ProtocolFormat::JsonLegacy),
73+
"postcard-legacy" => Ok(ProtocolFormat::PostcardLegacy),
7274
_ => Err(format!("unknown protocol format: {input}")),
7375
}
7476
}

0 commit comments

Comments
 (0)