Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): Fix latest clippy errors in Rust code (#1895) #1904

Merged
merged 1 commit into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/scala.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
components: rustfmt, clippy
target: x86_64-apple-darwin, aarch64-apple-darwin, aarch64-unknown-linux-gnu
cache-workspaces: "core/src/rust -> target"
toolchain: 1.83.0
- name: Install cargo-zigbuild
run: pip install cargo-zigbuild
- name: Run tests
Expand Down
2 changes: 1 addition & 1 deletion core/src/rust/filodb_core/src/ingestion/fields.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ fn parse_map_field<'a>(
// Capture value
doc.map_values
.get_mut(map_name.as_ref())
.ok_or_else(|| Err::Failure(ParserError::InternalMapError))?
.ok_or(Err::Failure(ParserError::InternalMapError))?
.insert(field_name.to_string(), value.to_string().into());
doc.field_names.push(field_name.to_string());

Expand Down
2 changes: 1 addition & 1 deletion core/src/rust/filodb_core/src/query_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub mod filodb_query;
/// 03 00 - string of length 3
/// 44 45 46 - UTF8 encoding of 'DEF'
/// 00 - end of boolean query

///
/// Query type encoding
#[derive(FromPrimitive)]
#[repr(u8)]
Expand Down
2 changes: 1 addition & 1 deletion core/src/rust/tantivy_utils/src/collectors/column_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl<'a> From<CacheKey<'a>> for (SegmentId, String) {
}
}

impl<'a> Equivalent<(SegmentId, String)> for CacheKey<'a> {
impl Equivalent<(SegmentId, String)> for CacheKey<'_> {
fn equivalent(&self, key: &(SegmentId, String)) -> bool {
self.0 == key.0 && self.1 == key.1
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ impl<'a> StringFieldCollector<'a> {
}
}

impl<'a> LimitedCollector for StringFieldCollector<'a> {
impl LimitedCollector for StringFieldCollector<'_> {
fn limit(&self) -> usize {
self.limit
}
}

impl<'a> Collector for StringFieldCollector<'a> {
impl Collector for StringFieldCollector<'_> {
type Fruit = Vec<(String, u64)>;

type Child = StringFieldSegmentCollector;
Expand Down Expand Up @@ -153,7 +153,7 @@ impl SegmentCollector for StringFieldSegmentCollector {
}
}

impl<'a> IndexCollector for StringFieldCollector<'a> {
impl IndexCollector for StringFieldCollector<'_> {
fn collect_over_index(
&self,
reader: &tantivy::SegmentReader,
Expand Down
4 changes: 2 additions & 2 deletions core/src/rust/tantivy_utils/src/collectors/time_collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ impl<'a> TimeCollector<'a> {
}
}

impl<'a> LimitedCollector for TimeCollector<'a> {
impl LimitedCollector for TimeCollector<'_> {
fn limit(&self) -> usize {
self.limit
}
}

impl<'a> Collector for TimeCollector<'a> {
impl Collector for TimeCollector<'_> {
// Tuple of part_id, time
type Fruit = Vec<(i32, i64)>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ where
}
}

impl<'a, T> LimitedCollector for TimeRangeFilter<'a, T>
impl<T> LimitedCollector for TimeRangeFilter<'_, T>
where
T: LimitedCollector,
T::Child: LimitedSegmentCollector,
Expand All @@ -52,7 +52,7 @@ where
}
}

impl<'a, T> Collector for TimeRangeFilter<'a, T>
impl<T> Collector for TimeRangeFilter<'_, T>
where
T: LimitedCollector,
T::Child: LimitedSegmentCollector,
Expand Down
2 changes: 1 addition & 1 deletion core/src/rust/tantivy_utils/src/query/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ where
}
}

impl<'a, QueryType> Equivalent<(SegmentId, QueryType)> for CachableQueryKey<'a, QueryType>
impl<QueryType> Equivalent<(SegmentId, QueryType)> for CachableQueryKey<'_, QueryType>
where
QueryType: Clone + PartialEq + Eq,
{
Expand Down
Loading