Skip to content

Commit ec6cb02

Browse files
authored
Apply clippy::semicolon_if_nothing_returned (#2410)
This is for consistency: if a block returns `()`, and the last expression of the block also returns `()`, then the final `;` can be left out. However, this is a little confusing (I was asked about this in a class today) and it is inconsistent. See https://rust-lang.github.io/rust-clippy/master/index.html#/semicolon_if_nothing_returned for details.
1 parent 3d1339c commit ec6cb02

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

mdbook-course/src/markdown.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ impl<const N: usize> fmt::Display for Table<N> {
9292
self.write_row(f, self.header.iter().map(|s| s.as_str()))?;
9393
self.write_row(f, self.header.iter().map(|_| "-"))?;
9494
for row in &self.rows {
95-
self.write_row(f, row.iter().map(|s| s.as_str()))?
95+
self.write_row(f, row.iter().map(|s| s.as_str()))?;
9696
}
9797
Ok(())
9898
}
@@ -156,42 +156,42 @@ mod test {
156156

157157
#[test]
158158
fn duration_no_time() {
159-
assert_eq!(duration(0), "0 minutes")
159+
assert_eq!(duration(0), "0 minutes");
160160
}
161161

162162
#[test]
163163
fn duration_single_minute() {
164-
assert_eq!(duration(1), "1 minute")
164+
assert_eq!(duration(1), "1 minute");
165165
}
166166

167167
#[test]
168168
fn duration_two_minutes() {
169-
assert_eq!(duration(2), "2 minutes")
169+
assert_eq!(duration(2), "2 minutes");
170170
}
171171

172172
#[test]
173173
fn duration_seven_minutes() {
174-
assert_eq!(duration(7), "10 minutes")
174+
assert_eq!(duration(7), "10 minutes");
175175
}
176176

177177
#[test]
178178
fn duration_hour() {
179-
assert_eq!(duration(60), "1 hour")
179+
assert_eq!(duration(60), "1 hour");
180180
}
181181

182182
#[test]
183183
fn duration_hour_mins() {
184-
assert_eq!(duration(61), "1 hour and 5 minutes")
184+
assert_eq!(duration(61), "1 hour and 5 minutes");
185185
}
186186

187187
#[test]
188188
fn duration_hours() {
189-
assert_eq!(duration(120), "2 hours")
189+
assert_eq!(duration(120), "2 hours");
190190
}
191191

192192
#[test]
193193
fn duration_hours_mins() {
194-
assert_eq!(duration(130), "2 hours and 10 minutes")
194+
assert_eq!(duration(130), "2 hours and 10 minutes");
195195
}
196196

197197
#[test]

src/android/aidl/birthday_service/src/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ fn main() {
2929
);
3030
binder::add_service(SERVICE_IDENTIFIER, birthday_service_binder.as_binder())
3131
.expect("Failed to register service");
32-
binder::ProcessState::join_thread_pool()
32+
binder::ProcessState::join_thread_pool();
3333
}

src/bare-metal/aps/examples/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ fn main() {
2323
.file("entry.S")
2424
.file("exceptions.S")
2525
.file("idmap.S")
26-
.compile("empty")
26+
.compile("empty");
2727
}

0 commit comments

Comments
 (0)