Skip to content

Commit dc8dc50

Browse files
committed
fixed clippy lints
1 parent 8128b77 commit dc8dc50

File tree

8 files changed

+18
-17
lines changed

8 files changed

+18
-17
lines changed

plugins/csharp/src/cs_test_result.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use tmc_langs_framework::TestResult;
77
/// Test result from the C# test runner.
88
#[derive(Debug, Deserialize)]
99
#[serde(rename_all = "PascalCase")]
10+
#[allow(clippy::upper_case_acronyms)]
1011
pub struct CSTestResult {
1112
pub name: String,
1213
pub passed: bool,

plugins/csharp/src/error.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ impl From<CSharpError> for TmcError {
3232
}
3333

3434
// conversion from plugin error to a tmc result
35-
impl<T> Into<Result<T, TmcError>> for CSharpError {
36-
fn into(self) -> Result<T, TmcError> {
37-
Err(TmcError::Plugin(Box::new(self)))
35+
impl<T> From<CSharpError> for Result<T, TmcError> {
36+
fn from(from: CSharpError) -> Self {
37+
Err(TmcError::Plugin(Box::new(from)))
3838
}
3939
}

plugins/java/src/error.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ impl From<JavaError> for TmcError {
4747
}
4848

4949
// conversion from plugin error to a tmc result
50-
impl<T> Into<Result<T, TmcError>> for JavaError {
51-
fn into(self) -> Result<T, TmcError> {
52-
Err(TmcError::Plugin(Box::new(self)))
50+
impl<T> From<JavaError> for Result<T, TmcError> {
51+
fn from(from: JavaError) -> Self {
52+
Err(TmcError::Plugin(Box::new(from)))
5353
}
5454
}

plugins/java/src/java_plugin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub(crate) trait JavaPlugin: LanguagePlugin {
4747
self.create_run_result_file(project_root_path, timeout, compile_result)?;
4848
let result = self.parse_test_result(&test_result);
4949
file_util::remove_file(&test_result.test_results)?;
50-
Ok(result?)
50+
result
5151
}
5252

5353
/// Parses test results.

plugins/make/src/error.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ impl From<MakeError> for TmcError {
3838
}
3939

4040
// conversion from plugin error to a tmc result
41-
impl<T> Into<Result<T, TmcError>> for MakeError {
42-
fn into(self) -> Result<T, TmcError> {
43-
Err(TmcError::Plugin(Box::new(self)))
41+
impl<T> From<MakeError> for Result<T, TmcError> {
42+
fn from(from: MakeError) -> Self {
43+
Err(TmcError::Plugin(Box::new(from)))
4444
}
4545
}

plugins/python3/src/error.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ impl From<PythonError> for TmcError {
3939
}
4040

4141
// conversion from plugin error to a tmc result
42-
impl<T> Into<Result<T, TmcError>> for PythonError {
43-
fn into(self) -> Result<T, TmcError> {
44-
Err(TmcError::Plugin(Box::new(self)))
42+
impl<T> From<PythonError> for Result<T, TmcError> {
43+
fn from(from: PythonError) -> Self {
44+
Err(TmcError::Plugin(Box::new(from)))
4545
}
4646
}

plugins/r/src/error.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ impl From<RError> for TmcError {
2424
}
2525

2626
// conversion from plugin error to a tmc result
27-
impl<T> Into<Result<T, TmcError>> for RError {
28-
fn into(self) -> Result<T, TmcError> {
29-
Err(TmcError::Plugin(Box::new(self)))
27+
impl<T> From<RError> for Result<T, TmcError> {
28+
fn from(from: RError) -> Self {
29+
Err(TmcError::Plugin(Box::new(from)))
3030
}
3131
}

tmc-langs-util/src/file_util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ pub fn write_to_writer<S: AsRef<[u8]>, W: Write>(
150150
) -> Result<(), FileError> {
151151
target
152152
.write_all(source.as_ref())
153-
.map_err(|e| FileError::WriteError(e))?;
153+
.map_err(FileError::WriteError)?;
154154
Ok(())
155155
}
156156

0 commit comments

Comments
 (0)