Skip to content

Commit cf494b6

Browse files
committed
fix clippy lints
1 parent fdb34c2 commit cf494b6

File tree

10 files changed

+24
-15
lines changed

10 files changed

+24
-15
lines changed

plugins/csharp/src/plugin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ impl LanguagePlugin for CSharpPlugin {
349349
vec![PathBuf::from("test")]
350350
}
351351

352-
fn points_parser<'a>(i: &'a str) -> IResult<&'a str, &'a str> {
352+
fn points_parser(i: &str) -> IResult<&str, &str> {
353353
combinator::map(
354354
sequence::delimited(
355355
sequence::tuple((

plugins/java/src/ant_plugin.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ impl LanguagePlugin for AntPlugin {
127127
Ok(())
128128
}
129129

130-
fn points_parser<'a>(i: &'a str) -> IResult<&'a str, &'a str> {
130+
fn points_parser(i: &str) -> IResult<&str, &str> {
131131
Self::java_points_parser(i)
132132
}
133133

@@ -569,7 +569,10 @@ mod test {
569569
if let Some(cmd_error) =
570570
inner.downcast_ref::<tmc_langs_framework::error::CommandError>()
571571
{
572-
if matches!(cmd_error, tmc_langs_framework::error::CommandError::TimeOut {..}) {
572+
if matches!(
573+
cmd_error,
574+
tmc_langs_framework::error::CommandError::TimeOut { .. }
575+
) {
573576
return;
574577
}
575578
}

plugins/java/src/java_plugin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ pub(crate) trait JavaPlugin: LanguagePlugin {
254254
}
255255

256256
/// Parses @Points("1.1") point annotations.
257-
fn java_points_parser<'a>(i: &'a str) -> IResult<&'a str, &'a str> {
257+
fn java_points_parser(i: &str) -> IResult<&str, &str> {
258258
combinator::map(
259259
sequence::delimited(
260260
sequence::tuple((

plugins/java/src/maven_plugin.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ impl LanguagePlugin for MavenPlugin {
133133
vec![PathBuf::from("src/test")]
134134
}
135135

136-
fn points_parser<'a>(i: &'a str) -> IResult<&'a str, &'a str> {
136+
fn points_parser(i: &str) -> IResult<&str, &str> {
137137
Self::java_points_parser(i)
138138
}
139139
}
@@ -422,7 +422,10 @@ mod test {
422422
if let Some(cmd_error) =
423423
inner.downcast_ref::<tmc_langs_framework::error::CommandError>()
424424
{
425-
if matches!(cmd_error, tmc_langs_framework::error::CommandError::TimeOut {..}) {
425+
if matches!(
426+
cmd_error,
427+
tmc_langs_framework::error::CommandError::TimeOut { .. }
428+
) {
426429
return;
427430
}
428431
}

plugins/make/src/plugin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ impl LanguagePlugin for MakePlugin {
316316
vec![PathBuf::from("test")]
317317
}
318318

319-
fn points_parser<'a>(i: &'a str) -> IResult<&'a str, &'a str> {
319+
fn points_parser(i: &str) -> IResult<&str, &str> {
320320
combinator::map(
321321
sequence::delimited(
322322
sequence::tuple((

plugins/notests/src/plugin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ impl LanguagePlugin for NoTestsPlugin {
102102
vec![PathBuf::from("test")]
103103
}
104104

105-
fn points_parser<'a>(_: &'a str) -> IResult<&'a str, &'a str> {
105+
fn points_parser(_: &str) -> IResult<&str, &str> {
106106
Ok(("", ""))
107107
}
108108
}

plugins/python3/src/plugin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ impl LanguagePlugin for Python3Plugin {
318318
vec![PathBuf::from("test"), PathBuf::from("tmc")]
319319
}
320320

321-
fn points_parser<'a>(i: &'a str) -> IResult<&'a str, &'a str> {
321+
fn points_parser(i: &str) -> IResult<&str, &str> {
322322
combinator::map(
323323
sequence::delimited(
324324
sequence::tuple((

plugins/r/src/plugin.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ impl LanguagePlugin for RPlugin {
151151
vec![PathBuf::from("tests")]
152152
}
153153

154-
fn points_parser<'a>(i: &'a str) -> IResult<&'a str, &'a str> {
154+
fn points_parser(i: &str) -> IResult<&str, &str> {
155155
combinator::map(
156156
sequence::delimited(
157157
sequence::tuple((
@@ -414,7 +414,10 @@ test("sample", c("r1.1"), {
414414
if let Some(cmd_error) =
415415
inner.downcast_ref::<tmc_langs_framework::error::CommandError>()
416416
{
417-
if matches!(cmd_error, tmc_langs_framework::error::CommandError::TimeOut {..}) {
417+
if matches!(
418+
cmd_error,
419+
tmc_langs_framework::error::CommandError::TimeOut { .. }
420+
) {
418421
return;
419422
}
420423
}

tmc-langs-cli/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,7 @@ fn run_core(
926926
let download_result = client.download_or_update_exercises(exercises_and_paths);
927927
let (downloaded, failed) = match download_result {
928928
Ok(_) => {
929-
let downloaded = to_be_downloaded.into_iter().map(|(k, v)| v).collect();
929+
let downloaded = to_be_downloaded.into_iter().map(|(_, v)| v).collect();
930930
let failed = vec![];
931931
(downloaded, failed)
932932
}
@@ -989,7 +989,7 @@ fn run_core(
989989
// add an error trace to each failed download
990990
let failed = failed
991991
.into_iter()
992-
.map(|((ex, id, checksum), err)| {
992+
.map(|((ex, ..), err)| {
993993
let mut error = &err as &dyn StdError;
994994
let mut chain = vec![error.to_string()];
995995
while let Some(source) = error.source() {
@@ -1438,7 +1438,7 @@ fn run_core(
14381438
}
14391439
}
14401440
("update-exercises", Some(_)) => {
1441-
let mut exercises_to_update = vec![];
1441+
let exercises_to_update = vec![];
14421442
let mut to_be_downloaded = vec![];
14431443
let mut to_be_skipped = vec![];
14441444
let mut course_data = HashMap::<String, Vec<(String, String, usize)>>::new();

tmc-langs-framework/src/plugin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ pub trait LanguagePlugin {
482482
/// A nom parser that recognizes a points annotation and returns the inner points value.
483483
///
484484
/// For example implementations, see the existing language plugins.
485-
fn points_parser<'a>(i: &'a str) -> IResult<&'a str, &'a str>;
485+
fn points_parser(i: &str) -> IResult<&str, &str>;
486486
}
487487

488488
#[derive(Debug, Clone)]

0 commit comments

Comments
 (0)