Skip to content

Commit

Permalink
Remove needless lifetimes to fix Clippy warnings
Browse files Browse the repository at this point in the history
The new needless_lifetimes lint [0], that got added in version 1.29.0,
reported these lifetime annotations which can be removed by relying on
lifetime elision.

This fixes our optional CI Clippy check with the beta toolchain.

[0]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes

Signed-off-by: Michael Weiss <michael.weiss@eviden.com>
  • Loading branch information
primeos-work committed Nov 4, 2024
1 parent f2c8507 commit 7692b8e
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/db/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub struct DbConnectionConfig<'a> {
database_connection_timeout: u16,
}

impl<'a> std::fmt::Debug for DbConnectionConfig<'a> {
impl std::fmt::Debug for DbConnectionConfig<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(
f,
Expand Down
2 changes: 1 addition & 1 deletion src/filestore/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ impl<'a> FullArtifactPath<'a> {
#[derive(Debug)]
pub struct FullArtifactPathDisplay<'a>(&'a StoreRoot, &'a ArtifactPath);

impl<'a> std::fmt::Display for FullArtifactPathDisplay<'a> {
impl std::fmt::Display for FullArtifactPathDisplay<'_> {
fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(fmt, "{}/{}", self.0.display(), self.1.display())
}
Expand Down
2 changes: 1 addition & 1 deletion src/orchestrator/orchestrator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ struct JobTask<'a> {
/// runtime stops running it because some other `JobTask` errored.
///
/// In the latter case, we cleanup by telling the progressbar to finish.
impl<'a> Drop for JobTask<'a> {
impl Drop for JobTask<'_> {
fn drop(&mut self) {
if !self.bar.is_finished() {
// If there are dependencies, the error is probably from another task
Expand Down
2 changes: 1 addition & 1 deletion src/orchestrator/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl AsReceivedErrorDisplay for HashMap<Uuid, Error> {

pub struct ReceivedErrorDisplay<'a>(&'a HashMap<Uuid, Error>);

impl<'a> std::fmt::Display for ReceivedErrorDisplay<'a> {
impl std::fmt::Display for ReceivedErrorDisplay<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
self.0
.iter()
Expand Down
2 changes: 1 addition & 1 deletion src/package/dag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ impl Dag {
#[derive(Clone)]
pub struct DagDisplay<'a>(&'a Dag, daggy::NodeIndex, Option<daggy::EdgeIndex>);

impl<'a> TreeItem for DagDisplay<'a> {
impl TreeItem for DagDisplay<'_> {
type Child = Self;

fn write_self<W: Write>(&self, f: &mut W, _: &Style) -> IoResult<()> {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ pub fn handlebars_for_package_printing(format: &str) -> Result<Handlebars> {
Ok(hb)
}

impl<'a, P: Borrow<Package>> PreparePrintPackage<'a, P> {
impl<P: Borrow<Package>> PreparePrintPackage<'_, P> {
pub fn into_displayable(self) -> Result<PrintablePackage> {
let script = ScriptBuilder::new(&Shebang::from(self.config.shebang().clone()))
.build(
Expand Down

0 comments on commit 7692b8e

Please sign in to comment.