Skip to content

Commit d141c80

Browse files
committed
Fixed clippy lints
1 parent bec55e7 commit d141c80

File tree

6 files changed

+8
-13
lines changed

6 files changed

+8
-13
lines changed

plugins/csharp/src/plugin.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,7 @@ impl LanguagePlugin for CSharpPlugin {
358358
|points| {
359359
points
360360
.into_iter()
361-
.map(|p| p.split_whitespace())
362-
.flatten()
361+
.flat_map(|p| p.split_whitespace())
363362
.collect()
364363
},
365364
)(i)

plugins/java/src/java_plugin.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,7 @@ pub(crate) trait JavaPlugin: LanguagePlugin {
276276
|points| {
277277
points
278278
.into_iter()
279-
.map(|p| p.split_whitespace())
280-
.flatten()
279+
.flat_map(|p| p.split_whitespace())
281280
.collect()
282281
},
283282
)(i)

plugins/python3/src/plugin.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,7 @@ impl LanguagePlugin for Python3Plugin {
467467
|points| {
468468
points
469469
.into_iter()
470-
.map(|p| p.split_whitespace())
471-
.flatten()
470+
.flat_map(|p| p.split_whitespace())
472471
.collect()
473472
},
474473
)(i)

tmc-langs/src/config/projects_config.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ impl ProjectsConfig {
9494
pub fn get_all_exercises(&self) -> impl Iterator<Item = &ProjectsDirExercise> {
9595
self.courses
9696
.iter()
97-
.map(|c| &c.1.exercises)
98-
.flatten()
97+
.flat_map(|c| &c.1.exercises)
9998
.map(|e| e.1)
10099
}
101100

tmc-langs/src/course_refresher.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ fn initialize_new_cache_clone(
187187
file_util::copy(old_clone_path, new_course_root)?;
188188

189189
let run_git = |args: &[&str]| {
190-
TmcCommand::piped("git".to_string())
190+
TmcCommand::piped("git")
191191
.with(|e| e.cwd(new_clone_path).args(args))
192192
.output_with_timeout_checked(Duration::from_secs(60 * 2))
193193
};
@@ -215,7 +215,7 @@ fn initialize_new_cache_clone(
215215
log::info!("could not copy from previous cache, cloning");
216216

217217
// clone_repository
218-
TmcCommand::piped("git".to_string())
218+
TmcCommand::piped("git")
219219
.with(|e| {
220220
e.args(&["clone", "-q", "-b"])
221221
.arg(course_git_branch)
@@ -304,7 +304,7 @@ fn get_exercises(
304304
"processing points and checksum for {}",
305305
exercise_dir.display()
306306
);
307-
let name = exercise_dir.to_string_lossy().replace("/", "-");
307+
let name = exercise_dir.to_string_lossy().replace('/', "-");
308308
let checksum = calculate_checksum(&course_stub_path.join(&exercise_dir))?;
309309
let exercise_path = course_clone_path.join(&exercise_dir);
310310
let points = super::get_available_points(&exercise_path)?;

tmc-langs/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -593,8 +593,7 @@ pub fn update_exercises(
593593
let exercise_ids = projects_config
594594
.courses
595595
.iter_mut()
596-
.map(|c| &mut c.1.exercises)
597-
.flatten()
596+
.flat_map(|c| &mut c.1.exercises)
598597
.map(|e| e.1.id)
599598
.collect::<Vec<_>>();
600599

0 commit comments

Comments
 (0)