Skip to content

Commit

Permalink
updates rust to 1.74.0 and fix new clippy errors (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
TimSimpson authored Dec 12, 2023
1 parent ba750f5 commit 0b997b9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions base/src/errors/esc_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ impl EscError {
/// Returns the operation error as a Result. The purpose of this is to
/// make it possible to use the question mark to fetch the actual API
/// error, and pass back the other error if it was something else.
#[allow(clippy::result_large_err)]
pub fn api_response(self) -> std::result::Result<ApiResponseError, EscError> {
match self {
EscError::ApiResponse(err) => Ok(err),
Expand Down
3 changes: 3 additions & 0 deletions base/tests/error_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use esc_client_base::errors::ApiResponseError;
use esc_client_base::errors::ProblemDetails;
use esc_client_base::errors::Result;

#[allow(clippy::result_large_err)]
fn get_api_error() -> std::result::Result<i32, ApiResponseError> {
let status_code = reqwest::StatusCode::INTERNAL_SERVER_ERROR;
let problem_details = ProblemDetails {
Expand All @@ -19,11 +20,13 @@ fn get_api_error() -> std::result::Result<i32, ApiResponseError> {
Err(err)
}

#[allow(clippy::result_large_err)]
fn return_error() -> Result<i32> {
get_api_error()?;
panic!("get_api_error should have failed");
}

#[allow(clippy::result_large_err)]
fn expect_error() -> Result<u16> {
let result = return_error();
match result {
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.64.0"
channel = "1.74.0"
components = ["rustfmt", "clippy"]
2 changes: 1 addition & 1 deletion store/src/config/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl Settings {
.source(Box::new(err))
})?;

let settings_file = main_settings_file(&settings_dir);
let settings_file = main_settings_file(settings_dir);
tokio::fs::write(settings_file.as_path(), &bytes)
.await
.map_err(|err| {
Expand Down

0 comments on commit 0b997b9

Please sign in to comment.