Skip to content

Commit 55c0b86

Browse files
committed
Add semicolons for consistency
`clippy::semicolon_if_nothing_returned`
1 parent 60c5449 commit 55c0b86

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+151
-151
lines changed

crates/flycheck/src/lib.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ impl FlycheckActor {
179179
tracing::error!(
180180
"Flycheck failed to run the following command: {:?}",
181181
self.check_command()
182-
)
182+
);
183183
}
184184
self.progress(Progress::DidFinish(res));
185185
}
@@ -253,7 +253,7 @@ impl FlycheckActor {
253253
}
254254

255255
fn send(&self, check_task: Message) {
256-
(self.sender)(check_task)
256+
(self.sender)(check_task);
257257
}
258258
}
259259

@@ -334,15 +334,15 @@ impl CargoActor {
334334
// Skip certain kinds of messages to only spend time on what's useful
335335
JsonMessage::Cargo(message) => match message {
336336
cargo_metadata::Message::CompilerArtifact(artifact) if !artifact.fresh => {
337-
self.sender.send(CargoMessage::CompilerArtifact(artifact)).unwrap()
337+
self.sender.send(CargoMessage::CompilerArtifact(artifact)).unwrap();
338338
}
339339
cargo_metadata::Message::CompilerMessage(msg) => {
340-
self.sender.send(CargoMessage::Diagnostic(msg.message)).unwrap()
340+
self.sender.send(CargoMessage::Diagnostic(msg.message)).unwrap();
341341
}
342342
_ => (),
343343
},
344344
JsonMessage::Rustc(message) => {
345-
self.sender.send(CargoMessage::Diagnostic(message)).unwrap()
345+
self.sender.send(CargoMessage::Diagnostic(message)).unwrap();
346346
}
347347
}
348348
}

crates/parser/src/grammar.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ pub(crate) mod entry_points {
6767
}
6868

6969
pub(crate) fn stmt(p: &mut Parser) {
70-
expressions::stmt(p, expressions::StmtWithSemi::No, true)
70+
expressions::stmt(p, expressions::StmtWithSemi::No, true);
7171
}
7272

7373
pub(crate) fn stmt_optional_semi(p: &mut Parser) {
74-
expressions::stmt(p, expressions::StmtWithSemi::Optional, false)
74+
expressions::stmt(p, expressions::StmtWithSemi::Optional, false);
7575
}
7676

7777
pub(crate) fn visibility(p: &mut Parser) {
@@ -84,7 +84,7 @@ pub(crate) mod entry_points {
8484
}
8585

8686
pub(crate) fn item(p: &mut Parser) {
87-
items::item_or_macro(p, true)
87+
items::item_or_macro(p, true);
8888
}
8989

9090
pub(crate) fn macro_items(p: &mut Parser) {
@@ -109,7 +109,7 @@ pub(crate) mod entry_points {
109109
}
110110

111111
pub(crate) fn attr(p: &mut Parser) {
112-
attributes::outer_attrs(p)
112+
attributes::outer_attrs(p);
113113
}
114114
}
115115

@@ -246,7 +246,7 @@ fn name_r(p: &mut Parser, recovery: TokenSet) {
246246
}
247247

248248
fn name(p: &mut Parser) {
249-
name_r(p, TokenSet::EMPTY)
249+
name_r(p, TokenSet::EMPTY);
250250
}
251251

252252
fn name_ref(p: &mut Parser) {

crates/parser/src/grammar/attributes.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ use super::*;
22

33
pub(super) fn inner_attrs(p: &mut Parser) {
44
while p.at(T![#]) && p.nth(1) == T![!] {
5-
attr(p, true)
5+
attr(p, true);
66
}
77
}
88

99
pub(super) fn outer_attrs(p: &mut Parser) {
1010
while p.at(T![#]) {
11-
attr(p, false)
11+
attr(p, false);
1212
}
1313
}
1414

crates/parser/src/grammar/expressions.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ pub(super) fn expr_block_contents(p: &mut Parser) {
139139
continue;
140140
}
141141

142-
stmt(p, StmtWithSemi::Yes, false)
142+
stmt(p, StmtWithSemi::Yes, false);
143143
}
144144
}
145145

@@ -468,12 +468,12 @@ fn field_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker {
468468
let m = lhs.precede(p);
469469
p.bump(T![.]);
470470
if p.at(IDENT) || p.at(INT_NUMBER) {
471-
name_ref_or_index(p)
471+
name_ref_or_index(p);
472472
} else if p.at(FLOAT_NUMBER) {
473473
// FIXME: How to recover and instead parse INT + T![.]?
474474
p.bump_any();
475475
} else {
476-
p.error("expected field name or number")
476+
p.error("expected field name or number");
477477
}
478478
m.complete(p, FIELD_EXPR)
479479
}

crates/parser/src/grammar/expressions/atom.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ fn match_expr(p: &mut Parser) -> CompletedMarker {
374374
if p.at(T!['{']) {
375375
match_arm_list(p);
376376
} else {
377-
p.error("expected `{`")
377+
p.error("expected `{`");
378378
}
379379
m.complete(p, MATCH_EXPR)
380380
}
@@ -602,7 +602,7 @@ fn try_block_expr(p: &mut Parser, m: Option<Marker>) -> CompletedMarker {
602602
if p.at(T!['{']) {
603603
stmt_list(p);
604604
} else {
605-
p.error("expected a block")
605+
p.error("expected a block");
606606
}
607607
m.complete(p, BLOCK_EXPR)
608608
}
@@ -639,7 +639,7 @@ fn meta_var_expr(p: &mut Parser) -> CompletedMarker {
639639
}
640640
_ => {
641641
while !p.at(R_DOLLAR) {
642-
p.bump_any()
642+
p.bump_any();
643643
}
644644
p.bump(R_DOLLAR);
645645
m.complete(p, ERROR)

crates/parser/src/grammar/generic_params.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ fn generic_param(p: &mut Parser) {
3434
T![const] => const_param(p, m),
3535
_ => {
3636
m.abandon(p);
37-
p.err_and_bump("expected type parameter")
37+
p.err_and_bump("expected type parameter");
3838
}
3939
}
4040
}
@@ -62,7 +62,7 @@ fn type_param(p: &mut Parser, m: Marker) {
6262
// test type_param_default
6363
// struct S<T = i32>;
6464
p.bump(T![=]);
65-
types::type_(p)
65+
types::type_(p);
6666
}
6767
m.complete(p, TYPE_PARAM);
6868
}

crates/parser/src/grammar/items.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use super::*;
2020
pub(super) fn mod_contents(p: &mut Parser, stop_on_r_curly: bool) {
2121
attributes::inner_attrs(p);
2222
while !p.at(EOF) && !(p.at(T!['}']) && stop_on_r_curly) {
23-
item_or_macro(p, stop_on_r_curly)
23+
item_or_macro(p, stop_on_r_curly);
2424
}
2525
}
2626

@@ -165,7 +165,7 @@ pub(super) fn opt_item(p: &mut Parser, m: Marker) -> Result<(), Marker> {
165165
p.bump_remap(T![default]);
166166
p.bump(T![async]);
167167
if is_unsafe {
168-
p.bump(T![unsafe])
168+
p.bump(T![unsafe]);
169169
}
170170
has_mods = true;
171171
}
@@ -404,7 +404,7 @@ fn fn_(p: &mut Parser, m: Marker) {
404404
// trait T { fn foo(); }
405405
p.bump(T![;]);
406406
} else {
407-
expressions::block_expr(p)
407+
expressions::block_expr(p);
408408
}
409409
m.complete(p, FN);
410410
}

crates/parser/src/grammar/items/adt.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pub(super) fn enum_(p: &mut Parser, m: Marker) {
5858
if p.at(T!['{']) {
5959
variant_list(p);
6060
} else {
61-
p.error("expected `{`")
61+
p.error("expected `{`");
6262
}
6363
m.complete(p, ENUM);
6464
}

crates/parser/src/grammar/items/consts.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ use super::*;
44
// const C: u32 = 92;
55
pub(super) fn konst(p: &mut Parser, m: Marker) {
66
p.bump(T![const]);
7-
const_or_static(p, m, true)
7+
const_or_static(p, m, true);
88
}
99

1010
pub(super) fn static_(p: &mut Parser, m: Marker) {
1111
p.bump(T![static]);
12-
const_or_static(p, m, false)
12+
const_or_static(p, m, false);
1313
}
1414

1515
fn const_or_static(p: &mut Parser, m: Marker, is_const: bool) {
@@ -27,7 +27,7 @@ fn const_or_static(p: &mut Parser, m: Marker, is_const: bool) {
2727
if p.at(T![:]) {
2828
types::ascription(p);
2929
} else {
30-
p.error("missing type for `const` or `static`")
30+
p.error("missing type for `const` or `static`");
3131
}
3232
if p.eat(T![=]) {
3333
expressions::expr(p);

crates/parser/src/grammar/params.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@ use super::*;
66
// fn c(x: i32, ) {}
77
// fn d(x: i32, y: ()) {}
88
pub(super) fn param_list_fn_def(p: &mut Parser) {
9-
list_(p, Flavor::FnDef)
9+
list_(p, Flavor::FnDef);
1010
}
1111

1212
// test param_list_opt_patterns
1313
// fn foo<F: FnMut(&mut Foo<'a>)>(){}
1414
pub(super) fn param_list_fn_trait(p: &mut Parser) {
15-
list_(p, Flavor::FnTrait)
15+
list_(p, Flavor::FnTrait);
1616
}
1717

1818
pub(super) fn param_list_fn_ptr(p: &mut Parser) {
19-
list_(p, Flavor::FnPointer)
19+
list_(p, Flavor::FnPointer);
2020
}
2121

2222
pub(super) fn param_list_closure(p: &mut Parser) {
23-
list_(p, Flavor::Closure)
23+
list_(p, Flavor::Closure);
2424
}
2525

2626
#[derive(Debug, Clone, Copy)]
@@ -104,13 +104,13 @@ fn param(p: &mut Parser, m: Marker, flavor: Flavor) -> Variadic {
104104
Flavor::FnDef => {
105105
patterns::pattern(p);
106106
if variadic_param(p) {
107-
res = Variadic(true)
107+
res = Variadic(true);
108108
} else if p.at(T![:]) {
109-
types::ascription(p)
109+
types::ascription(p);
110110
} else {
111111
// test_err missing_fn_param_type
112112
// fn f(x y: i32, z, t: i32) {}
113-
p.error("missing type for function parameter")
113+
p.error("missing type for function parameter");
114114
}
115115
}
116116
// test value_parameters_no_patterns
@@ -128,11 +128,11 @@ fn param(p: &mut Parser, m: Marker, flavor: Flavor) -> Variadic {
128128
if (p.at(IDENT) || p.at(UNDERSCORE)) && p.nth(1) == T![:] && !p.nth_at(1, T![::]) {
129129
patterns::pattern_single(p);
130130
if variadic_param(p) {
131-
res = Variadic(true)
131+
res = Variadic(true);
132132
} else if p.at(T![:]) {
133-
types::ascription(p)
133+
types::ascription(p);
134134
} else {
135-
p.error("missing type for function parameter")
135+
p.error("missing type for function parameter");
136136
}
137137
} else {
138138
types::type_(p);

crates/parser/src/grammar/paths.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ pub(super) fn is_use_path_start(p: &Parser) -> bool {
1616
}
1717

1818
pub(super) fn use_path(p: &mut Parser) {
19-
path(p, Mode::Use)
19+
path(p, Mode::Use);
2020
}
2121

2222
pub(crate) fn type_path(p: &mut Parser) {
23-
path(p, Mode::Type)
23+
path(p, Mode::Type);
2424
}
2525

2626
pub(super) fn expr_path(p: &mut Parser) {
27-
path(p, Mode::Expr)
27+
path(p, Mode::Expr);
2828
}
2929

3030
pub(crate) fn type_path_for_qualifier(p: &mut Parser, qual: CompletedMarker) -> CompletedMarker {
@@ -117,7 +117,7 @@ fn opt_path_type_args(p: &mut Parser, mode: Mode) {
117117
params::param_list_fn_trait(p);
118118
opt_ret_type(p);
119119
} else {
120-
generic_args::opt_generic_arg_list(p, false)
120+
generic_args::opt_generic_arg_list(p, false);
121121
}
122122
}
123123
Mode::Expr => generic_args::opt_generic_arg_list(p, true),

crates/parser/src/grammar/patterns.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub(crate) fn pattern(p: &mut Parser) {
1919

2020
/// Parses a pattern list separated by pipes `|`.
2121
pub(super) fn pattern_top(p: &mut Parser) {
22-
pattern_top_r(p, PAT_RECOVERY_SET)
22+
pattern_top_r(p, PAT_RECOVERY_SET);
2323
}
2424

2525
pub(crate) fn pattern_single(p: &mut Parser) {

crates/parser/src/grammar/types.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ fn type_with_bounds_cond(p: &mut Parser, allow_bounds: bool) {
5757
pub(super) fn ascription(p: &mut Parser) {
5858
assert!(p.at(T![:]));
5959
p.bump(T![:]);
60-
type_(p)
60+
type_(p);
6161
}
6262

6363
fn paren_or_tuple_type(p: &mut Parser) {
@@ -204,7 +204,7 @@ fn fn_ptr_type(p: &mut Parser) {
204204
if p.at(T!['(']) {
205205
params::param_list_fn_ptr(p);
206206
} else {
207-
p.error("expected parameters")
207+
p.error("expected parameters");
208208
}
209209
// test fn_pointer_type_with_ret
210210
// type F = fn() -> ();
@@ -274,7 +274,7 @@ fn dyn_trait_type(p: &mut Parser) {
274274
// type C = self::Foo;
275275
// type D = super::Foo;
276276
pub(super) fn path_type(p: &mut Parser) {
277-
path_type_(p, true)
277+
path_type_(p, true);
278278
}
279279

280280
// test macro_call_type

crates/parser/src/parser.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ impl<'t> Parser<'t> {
177177
if kind == EOF {
178178
return;
179179
}
180-
self.do_bump(kind, 1)
180+
self.do_bump(kind, 1);
181181
}
182182

183183
/// Advances the parser by one token, remapping its kind.
@@ -200,7 +200,7 @@ impl<'t> Parser<'t> {
200200
/// does.
201201
pub(crate) fn error<T: Into<String>>(&mut self, message: T) {
202202
let msg = ParseError(Box::new(message.into()));
203-
self.push_event(Event::Error { msg })
203+
self.push_event(Event::Error { msg });
204204
}
205205

206206
/// Consume the next token if it is `kind` or emit an error
@@ -258,7 +258,7 @@ impl<'t> Parser<'t> {
258258
}
259259

260260
fn push_event(&mut self, event: Event) {
261-
self.events.push(event)
261+
self.events.push(event);
262262
}
263263
}
264264

crates/parser/src/token_set.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ impl TokenSet {
1414
let mut i = 0;
1515
while i < kinds.len() {
1616
res |= mask(kinds[i]);
17-
i += 1
17+
i += 1;
1818
}
1919
TokenSet(res)
2020
}

crates/proc_macro_api/src/msg/flat.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ impl Reader {
320320
})
321321
.collect(),
322322
};
323-
res[i] = Some(s)
323+
res[i] = Some(s);
324324
}
325325

326326
res[0].take().unwrap()

0 commit comments

Comments
 (0)