Skip to content

Commit 708ec98

Browse files
bors[bot]matklad
andauthored
Merge #7895
7895: ⬆️ xflags r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 parents f0b7c02 + 0296cd5 commit 708ec98

File tree

5 files changed

+23
-21
lines changed

5 files changed

+23
-21
lines changed

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/rust-analyzer/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jod-thread = "0.1.0"
2424
log = "0.4.8"
2525
lsp-types = { version = "0.88.0", features = ["proposed"] }
2626
parking_lot = "0.11.0"
27-
xflags = "0.1.2"
27+
xflags = "0.2.1"
2828
oorandom = "11.1.2"
2929
rustc-hash = "1.1.0"
3030
serde = { version = "1.0.106", features = ["derive"] }

crates/rust-analyzer/src/bin/flags.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ use ide_ssr::{SsrPattern, SsrRule};
66
use rust_analyzer::cli::{BenchWhat, Position, Verbosity};
77
use vfs::AbsPathBuf;
88

9-
xflags::args_parser! {
9+
xflags::xflags! {
10+
src "./src/bin/flags.rs"
11+
1012
/// LSP server for the Rust programming language.
1113
cmd rust-analyzer {
1214
/// Verbosity level, can be repeated multiple times.
@@ -120,7 +122,7 @@ xflags::args_parser! {
120122

121123
// generated start
122124
// The following code is generated by `xflags` macro.
123-
// Run `env XFLAGS_DUMP= cargo build` to regenerate.
125+
// Run `env UPDATE_XFLAGS=1 cargo build` to regenerate.
124126
#[derive(Debug)]
125127
pub struct RustAnalyzer {
126128
pub verbose: u32,
@@ -158,7 +160,7 @@ pub struct Parse {
158160
}
159161

160162
#[derive(Debug)]
161-
pub struct Symbols {}
163+
pub struct Symbols;
162164

163165
#[derive(Debug)]
164166
pub struct Highlight {
@@ -211,14 +213,13 @@ pub struct Search {
211213
}
212214

213215
#[derive(Debug)]
214-
pub struct ProcMacro {}
216+
pub struct ProcMacro;
215217

216218
impl RustAnalyzer {
217-
pub const HELP: &'static str = Self::_HELP;
219+
pub const HELP: &'static str = Self::HELP_;
218220

219221
pub fn from_env() -> xflags::Result<Self> {
220-
let mut p = xflags::rt::Parser::new_from_env();
221-
Self::_parse(&mut p)
222+
Self::from_env_()
222223
}
223224
}
224225
// generated end

xtask/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ ungrammar = "=1.11"
1515
walkdir = "2.3.1"
1616
write-json = "0.1.0"
1717
xshell = "0.1"
18-
xflags = "0.1.2"
18+
xflags = "0.2.1"
1919
# Avoid adding more dependencies to this crate

xtask/src/flags.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
use crate::install::{ClientOpt, Malloc, ServerOpt};
44

5-
xflags::args_parser! {
5+
xflags::xflags! {
6+
src "./src/flags.rs"
7+
68
/// Run custom build command.
79
cmd xtask {
810
default cmd help {
@@ -55,7 +57,7 @@ xflags::args_parser! {
5557

5658
// generated start
5759
// The following code is generated by `xflags` macro.
58-
// Run `env XFLAGS_DUMP= cargo build` to regenerate.
60+
// Run `env UPDATE_XFLAGS=1 cargo build` to regenerate.
5961
#[derive(Debug)]
6062
pub struct Xtask {
6163
pub subcommand: XtaskCmd,
@@ -96,13 +98,13 @@ pub struct Codegen {
9698
}
9799

98100
#[derive(Debug)]
99-
pub struct Lint {}
101+
pub struct Lint;
100102

101103
#[derive(Debug)]
102-
pub struct FuzzTests {}
104+
pub struct FuzzTests;
103105

104106
#[derive(Debug)]
105-
pub struct PreCache {}
107+
pub struct PreCache;
106108

107109
#[derive(Debug)]
108110
pub struct Release {
@@ -131,11 +133,10 @@ pub struct Bb {
131133
}
132134

133135
impl Xtask {
134-
pub const HELP: &'static str = Self::_HELP;
136+
pub const HELP: &'static str = Self::HELP_;
135137

136138
pub fn from_env() -> xflags::Result<Self> {
137-
let mut p = xflags::rt::Parser::new_from_env();
138-
Self::_parse(&mut p)
139+
Self::from_env_()
139140
}
140141
}
141142
// generated end

0 commit comments

Comments
 (0)