From 7a61a31a08ecd85a61c9112e80b6856857e1a43f Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Wed, 24 Apr 2024 11:36:42 +0200 Subject: [PATCH] self review --- crates/re_query_cache/Cargo.toml | 2 +- crates/re_query_cache/README.md | 9 +++++++-- crates/re_query_cache/src/flat_vec_deque.rs | 3 +-- crates/re_query_cache/tests/latest_at.rs | 2 +- .../src/visualizers/results_ext.rs | 16 ++++------------ crates/re_types/source_hash.txt | 4 ---- 6 files changed, 14 insertions(+), 22 deletions(-) delete mode 100644 crates/re_types/source_hash.txt diff --git a/crates/re_query_cache/Cargo.toml b/crates/re_query_cache/Cargo.toml index d2bb57e25a22..71a9dfbe35ef 100644 --- a/crates/re_query_cache/Cargo.toml +++ b/crates/re_query_cache/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "re_query_cache" authors.workspace = true -description = "Temporary crate meant to replace re_query_cache" +description = "Caching datastructures for re_query" edition.workspace = true homepage.workspace = true include.workspace = true diff --git a/crates/re_query_cache/README.md b/crates/re_query_cache/README.md index 9886d43eb96e..70613732471d 100644 --- a/crates/re_query_cache/README.md +++ b/crates/re_query_cache/README.md @@ -1,5 +1,10 @@ # re_query_cache -Temporary crate for implementing the new cached data APIs. Not published. +Part of the [`rerun`](https://github.com/rerun-io/rerun) family of crates. -Will replace `re_query_cache` when ready. +[![Latest version](https://img.shields.io/crates/v/re_query_cache.svg)](https://crates.io/crates/re_query_cache) +[![Documentation](https://docs.rs/re_query/badge.svg)](https://docs.rs/re_query) +![MIT](https://img.shields.io/badge/license-MIT-blue.svg) +![Apache](https://img.shields.io/badge/license-Apache-blue.svg) + +Caching datastructures for `re_query`. diff --git a/crates/re_query_cache/src/flat_vec_deque.rs b/crates/re_query_cache/src/flat_vec_deque.rs index a5508f0391c1..1a89f41628e9 100644 --- a/crates/re_query_cache/src/flat_vec_deque.rs +++ b/crates/re_query_cache/src/flat_vec_deque.rs @@ -111,8 +111,7 @@ impl ErasedFlatVecDeque for FlatVecDeque { /// optimizes for writes. /// /// You can think of this as the native/deserialized version of an Arrow `ListArray`. -/// This is particularly useful when working with many small arrays of data (e.g. Rerun's -/// `TimeSeriesScalar`s). +/// This is particularly useful when working with many small arrays of data (e.g. Rerun's `Scalar`s). // // TODO(cmc): We could even use a bitmap for T=Option, which would bring this that much // closer to a deserialized version of an Arrow array. diff --git a/crates/re_query_cache/tests/latest_at.rs b/crates/re_query_cache/tests/latest_at.rs index b8ce810f7cc5..4073c5ec7e53 100644 --- a/crates/re_query_cache/tests/latest_at.rs +++ b/crates/re_query_cache/tests/latest_at.rs @@ -170,7 +170,7 @@ fn splatted_query() { } #[test] -fn invalidation_xxx() { +fn invalidation() { let entity_path = "point"; let test_invalidation = |query: LatestAtQuery, diff --git a/crates/re_space_view_spatial/src/visualizers/results_ext.rs b/crates/re_space_view_spatial/src/visualizers/results_ext.rs index 25913ef25f9d..27474a9cc886 100644 --- a/crates/re_space_view_spatial/src/visualizers/results_ext.rs +++ b/crates/re_space_view_spatial/src/visualizers/results_ext.rs @@ -80,15 +80,11 @@ impl CachedRangeResultsExt for CachedRangeResults { // TODO(#5607): what should happen if the promise is still pending? let (front_status, back_status) = results.status(); match front_status { - PromiseResult::Error(err) => { - return Err(re_query_cache::QueryError::Other(err.into())) - } + PromiseResult::Error(err) => return Err(re_query_cache::QueryError::Other(err.into())), PromiseResult::Pending | PromiseResult::Ready(_) => {} } match back_status { - PromiseResult::Error(err) => { - return Err(re_query_cache::QueryError::Other(err.into())) - } + PromiseResult::Error(err) => return Err(re_query_cache::QueryError::Other(err.into())), PromiseResult::Pending | PromiseResult::Ready(_) => {} } @@ -134,15 +130,11 @@ impl CachedRangeResultsExt for CachedLatestAtResults { // TODO(#5607): what should happen if the promise is still pending? let (front_status, back_status) = data.status(); match front_status { - PromiseResult::Error(err) => { - return Err(re_query_cache::QueryError::Other(err.into())) - } + PromiseResult::Error(err) => return Err(re_query_cache::QueryError::Other(err.into())), PromiseResult::Pending | PromiseResult::Ready(_) => {} } match back_status { - PromiseResult::Error(err) => { - return Err(re_query_cache::QueryError::Other(err.into())) - } + PromiseResult::Error(err) => return Err(re_query_cache::QueryError::Other(err.into())), PromiseResult::Pending | PromiseResult::Ready(_) => {} } diff --git a/crates/re_types/source_hash.txt b/crates/re_types/source_hash.txt deleted file mode 100644 index fb688c1700a4..000000000000 --- a/crates/re_types/source_hash.txt +++ /dev/null @@ -1,4 +0,0 @@ -# This is a sha256 hash for all direct and indirect dependencies of this crate's build script. -# It can be safely removed at anytime to force the build script to run again. -# Check out build.rs to see how it's computed. -f8f53668ae1b1cde953fd0ce121a39aeb107b7fe96047e4bfccd88bb88b757a8