Skip to content

Commit

Permalink
fix rust check & rerun lints
Browse files Browse the repository at this point in the history
  • Loading branch information
Wumpf committed Dec 19, 2024
1 parent 0531185 commit 2612288
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
9 changes: 5 additions & 4 deletions crates/store/re_log_types/src/path/entity_path_filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ impl From<EntityPath> for EntityPathRule {
impl std::ops::Deref for EntityPathRule {
type Target = str;

#[inline]
fn deref(&self) -> &Self::Target {
&self.0
}
Expand Down Expand Up @@ -410,14 +411,14 @@ impl EntityPathFilter {
}

/// Resolve variables & parse paths, ignoring any errors.
pub fn resolve_forgiving(self, subst_env: &EntityPathSubs) -> ResolvedEntityPathFilter {
pub fn resolve_forgiving(&self, subst_env: &EntityPathSubs) -> ResolvedEntityPathFilter {
let rules = self
.rules
.into_iter()
.iter()
.map(|(rule, effect)| {
(
ResolvedEntityPathRule::parse_forgiving(&rule, subst_env),
effect,
ResolvedEntityPathRule::parse_forgiving(rule, subst_env),
*effect,
)
})
.collect();
Expand Down
6 changes: 3 additions & 3 deletions crates/viewer/re_viewport_blueprint/src/viewport_blueprint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ impl ViewportBlueprint {
.map(|view| {
// Today this looks trivial and something like we could do during recommendation-creation. But in the future variable substitutions might become more complex!
let path_subs = EntityPathSubs::new_with_origin(&view.origin);
let query_filter = view.query_filter.clone().resolve_forgiving(&path_subs);
let query_filter = view.query_filter.resolve_forgiving(&path_subs);
(query_filter, view)
})
.collect::<Vec<_>>();
Expand All @@ -372,7 +372,7 @@ impl ViewportBlueprint {
recommended_views.retain(|(query_filter, _)| {
existing_path_filters
.iter()
.all(|existing_filter| !existing_filter.is_superset_of(&query_filter))
.all(|existing_filter| !existing_filter.is_superset_of(query_filter))
});

// Remove all views that are redundant within the remaining recommendation.
Expand All @@ -385,7 +385,7 @@ impl ViewportBlueprint {
.iter()
.enumerate()
.all(|(i, (other_query_filter, _))| {
i == *j || !other_query_filter.is_superset_of(&candidate_query_filter)
i == *j || !other_query_filter.is_superset_of(candidate_query_filter)
})
})
.map(|(_, recommendation)| recommendation);
Expand Down
6 changes: 4 additions & 2 deletions examples/rust/dataframe_query/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use itertools::Itertools;

use rerun::{
dataframe::{
concatenate_record_batches, EntityPathFilter, QueryEngine, QueryExpression,
concatenate_record_batches, EntityPathFilter, EntityPathSubs, QueryEngine, QueryExpression,
SparseFillStrategy, Timeline,
},
ChunkStoreConfig, StoreKind, VersionPolicy,
Expand Down Expand Up @@ -57,7 +57,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
filtered_index: Some(timeline),
view_contents: Some(
engine
.iter_entity_paths_sorted(&entity_path_filter)
.iter_entity_paths_sorted(
entity_path_filter.resolve_forgiving(&EntityPathSubs::empty()),
)
.map(|entity_path| (entity_path, None))
.collect(),
),
Expand Down

0 comments on commit 2612288

Please sign in to comment.