Skip to content

Commit

Permalink
Fix clippy regression
Browse files Browse the repository at this point in the history
See https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes

Was newly introduced

Also introducing a weekly cron to detect this type of regressions
  • Loading branch information
erikbosch committed Dec 5, 2024
1 parent bfcb1e4 commit 0af4e2c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/kuksa_databroker_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ on:
QUAY_IO_USERNAME:
required: true
workflow_dispatch:
# Run every Sunday night to check regressions, for example from clippy
schedule:
- cron: "0 4 * * 0"

# suffix to avoid cancellation when running from release workflow
concurrency:
Expand Down
10 changes: 5 additions & 5 deletions databroker/src/broker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,7 @@ pub enum EntryReadAccess<'a> {
Err(&'a Metadata, ReadError),
}

impl<'a> EntryReadAccess<'a> {
impl EntryReadAccess<'_> {
pub fn datapoint(&self) -> Result<&Datapoint, ReadError> {
match self {
Self::Entry(entry) => Ok(&entry.datapoint),
Expand Down Expand Up @@ -1151,7 +1151,7 @@ pub struct EntryReadIterator<'a, 'b> {
permissions: &'b Permissions,
}

impl<'a, 'b> Iterator for EntryReadIterator<'a, 'b> {
impl<'a> Iterator for EntryReadIterator<'a, '_> {
type Item = EntryReadAccess<'a>;

#[inline]
Expand All @@ -1167,7 +1167,7 @@ impl<'a, 'b> Iterator for EntryReadIterator<'a, 'b> {
}
}

impl<'a, 'b> DatabaseReadAccess<'a, 'b> {
impl DatabaseReadAccess<'_, '_> {
pub fn get_entry_by_id(&self, id: i32) -> Result<&Entry, ReadError> {
match self.db.entries.get(&id) {
Some(entry) => match self.permissions.can_read(&entry.metadata.path) {
Expand Down Expand Up @@ -1203,7 +1203,7 @@ impl<'a, 'b> DatabaseReadAccess<'a, 'b> {
}
}

impl<'a, 'b> DatabaseWriteAccess<'a, 'b> {
impl DatabaseWriteAccess<'_, '_> {
pub fn update_by_path(
&mut self,
path: &str,
Expand Down Expand Up @@ -1397,7 +1397,7 @@ impl Database {
}
}

impl<'a, 'b> query::CompilationInput for DatabaseReadAccess<'a, 'b> {
impl query::CompilationInput for DatabaseReadAccess<'_, '_> {
fn get_datapoint_type(&self, path: &str) -> Result<DataType, query::CompilationError> {
match self.get_metadata_by_path(path) {
Some(metadata) => Ok(metadata.data_type.to_owned()),
Expand Down

0 comments on commit 0af4e2c

Please sign in to comment.