Unverified Commit 6f54227e authored by Nugine's avatar Nugine
Browse files

lint: clippy::must_use_candidate

parent 203f38d7
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
#![forbid(unsafe_code)]
#![deny(clippy::all)]
#![deny(
    clippy::all, //
    clippy::must_use_candidate, //
)]

use s3s::service::SharedS3Service;
use s3s::{S3Error, S3Result};
+4 −1
Original line number Diff line number Diff line
#![forbid(unsafe_code)]
#![deny(clippy::all)]
#![deny(
    clippy::all, //
    clippy::must_use_candidate, //
)]

mod gen;

+1 −0
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@ pub struct Error {
pub type Result<T = (), E = Error> = std::result::Result<T, E>;

impl Error {
    #[must_use]
    #[track_caller]
    pub fn new(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
        log(&*source);
+4 −1
Original line number Diff line number Diff line
#![forbid(unsafe_code)]
#![deny(clippy::all)]
#![deny(
    clippy::all, //
    clippy::must_use_candidate, //
)]

#[macro_use]
mod error;
+3 −0
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ impl S3Error {
        }
    }

    #[must_use]
    pub fn with_source(code: S3ErrorCode, source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
        Self {
            code,
@@ -64,10 +65,12 @@ impl S3Error {
        self.source = Some(val);
    }

    #[must_use]
    pub fn code(&self) -> S3ErrorCode {
        self.code
    }

    #[must_use]
    pub fn message(&self) -> Option<&str> {
        self.message.as_deref()
    }
Loading