Skip to content

Commit

Permalink
Fixes findings from PR review
Browse files Browse the repository at this point in the history
  • Loading branch information
Artxiom committed May 14, 2024
1 parent 3628dbc commit e33895d
Show file tree
Hide file tree
Showing 76 changed files with 152 additions and 43 deletions.
3 changes: 3 additions & 0 deletions crates/re_data_store/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
#![doc = document_features::document_features!()]
//!
// TODO(#3408): remove unwrap()
#![allow(clippy::unwrap_used)]

mod arrow_util;
mod store;
mod store_arrow;
Expand Down
3 changes: 3 additions & 0 deletions crates/re_dev_tools/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
//!
//! To get an overview over all tools run `pixi run dev-tools --help`.
// TODO(#3408): remove unwrap()
#![allow(clippy::unwrap_used)]

use argh::FromArgs;

mod build_examples;
Expand Down
3 changes: 3 additions & 0 deletions crates/re_entity_db/examples/memory_usage.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// TODO(#3408): remove unwrap()
#![allow(clippy::unwrap_used)]

use std::sync::atomic::{AtomicUsize, Ordering::Relaxed};

thread_local! {
Expand Down
3 changes: 3 additions & 0 deletions crates/re_entity_db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
#![doc = document_features::document_features!()]
//!
// TODO(#3408): remove unwrap()
#![allow(clippy::unwrap_used)]

pub mod entity_db;
pub mod entity_properties;
pub mod entity_tree;
Expand Down
3 changes: 3 additions & 0 deletions crates/re_format_arrow/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
//! Formatting for tables of Arrow arrays
// TODO(#3408): remove unwrap()
#![allow(clippy::unwrap_used)]

use std::fmt::Formatter;

use arrow2::{
Expand Down
3 changes: 3 additions & 0 deletions crates/re_log_types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
//! e.g. the entity `foo/bar/baz` is has the transform that is the product of
//! `foo.transform * foo/bar.transform * foo/bar/baz.transform`.
// TODO(#3408): remove unwrap()
#![allow(clippy::unwrap_used)]

pub mod arrow_msg;
pub mod example_components;
pub mod hash;
Expand Down
5 changes: 4 additions & 1 deletion crates/re_query/src/latest_at/results.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,5 +285,8 @@ fn downcast<C: Component>(cached: &(dyn ErasedFlatVecDeque + Send + Sync)) -> cr
if cached.num_entries() != 1 {
return Err(anyhow::anyhow!("latest_at deque must be single entry").into());
}
Ok(cached.iter().next().expect("checked just above ^^^"))
Ok(cached
.iter()
.next()
.expect("checked existence of cached value already"))
}
3 changes: 3 additions & 0 deletions crates/re_query/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
//! Caching datastructures for `re_query`.
// TODO(#3408): remove unwrap()
#![allow(clippy::unwrap_used)]

mod cache;
mod cache_stats;
mod flat_vec_deque;
Expand Down
3 changes: 3 additions & 0 deletions crates/re_renderer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
#![doc = document_features::document_features!()]
//!
// TODO(#3408): remove unwrap()
#![allow(clippy::unwrap_used)]

pub mod config;
pub mod importer;
pub mod mesh;
Expand Down
3 changes: 3 additions & 0 deletions crates/re_renderer_examples/2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
//!
//! On the left is a 2D view, on the right a 3D view of the same scene.
// TODO(#3408): remove unwrap()
#![allow(clippy::unwrap_used)]

use itertools::Itertools as _;
use re_renderer::Hsva;

Expand Down
3 changes: 3 additions & 0 deletions crates/re_renderer_examples/depth_cloud.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
//! cargo run-wasm --example depth_cloud
//! ```
// TODO(#3408): remove unwrap()
#![allow(clippy::unwrap_used)]

use std::f32::consts::TAU;

use glam::Vec3;
Expand Down
3 changes: 3 additions & 0 deletions crates/re_renderer_examples/depth_offset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
//! Press arrow up/down to increase/decrease the distance of the camera to the z==0 plane in tandem with the scale of the rectangles.
//! Press arrow left/right to increase/decrease the near plane distance.
// TODO(#3408): remove unwrap()
#![allow(clippy::unwrap_used)]

use re_renderer::Hsva;
use re_renderer::{
renderer::{ColormappedTexture, RectangleDrawData, RectangleOptions, TexturedRect},
Expand Down
3 changes: 3 additions & 0 deletions crates/re_renderer_examples/framework.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
//! Example framework
// TODO(#3408): remove unwrap()
#![allow(clippy::unwrap_used)]

use std::sync::Arc;

use anyhow::Context as _;
Expand Down
3 changes: 3 additions & 0 deletions crates/re_renderer_examples/multiview.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
//! Example with several independent views, using various primitives.
// TODO(#3408): remove unwrap()
#![allow(clippy::unwrap_used)]

use std::f32::consts::TAU;

use framework::Example;
Expand Down
3 changes: 3 additions & 0 deletions crates/re_renderer_examples/outlines.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
//! Demonstrates outline rendering.
// TODO(#3408): remove unwrap()
#![allow(clippy::unwrap_used)]

use itertools::Itertools;
use re_renderer::{
renderer::MeshInstance,
Expand Down
3 changes: 3 additions & 0 deletions crates/re_renderer_examples/picking.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
//! Demonstrates the dedicated picking layer support.
// TODO(#3408): remove unwrap()
#![allow(clippy::unwrap_used)]

use itertools::Itertools as _;
use rand::Rng;
use re_renderer::{
Expand Down
2 changes: 2 additions & 0 deletions crates/re_sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#![doc = document_features::document_features!()]
//!
// TODO(#3408): remove unwrap()
#![allow(clippy::unwrap_used)]
#![warn(missing_docs)] // Let's keep the this crate well-documented!

// ----------------
Expand Down
18 changes: 6 additions & 12 deletions crates/re_sdk/src/recording_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,7 @@ impl RecordingStreamBuilder {
/// # Ok::<(), Box<dyn std::error::Error>>(())
/// ```
pub fn connect(self) -> RecordingStreamResult<RecordingStream> {
self.connect_opts(
crate::default_server_addr(),
Some(crate::default_flush_timeout()),
)
self.connect_opts(crate::default_server_addr(), crate::default_flush_timeout())
}

/// Creates a new [`RecordingStream`] that is pre-configured to stream the data through to a
Expand All @@ -328,7 +325,7 @@ impl RecordingStreamBuilder {
///
/// ```no_run
/// let rec = re_sdk::RecordingStreamBuilder::new("rerun_example_app")
/// .connect_opts(re_sdk::default_server_addr(), Some(re_sdk::default_flush_timeout()))?;
/// .connect_opts(re_sdk::default_server_addr(), re_sdk::default_flush_timeout())?;
/// # Ok::<(), Box<dyn std::error::Error>>(())
/// ```
pub fn connect_opts(
Expand Down Expand Up @@ -425,7 +422,7 @@ impl RecordingStreamBuilder {
/// # Ok::<(), Box<dyn std::error::Error>>(())
/// ```
pub fn spawn(self) -> RecordingStreamResult<RecordingStream> {
self.spawn_opts(&Default::default(), Some(crate::default_flush_timeout()))
self.spawn_opts(&Default::default(), crate::default_flush_timeout())
}

/// Spawns a new Rerun Viewer process from an executable available in PATH, then creates a new
Expand All @@ -445,7 +442,7 @@ impl RecordingStreamBuilder {
///
/// ```no_run
/// let rec = re_sdk::RecordingStreamBuilder::new("rerun_example_app")
/// .spawn_opts(&re_sdk::SpawnOptions::default(), Some(re_sdk::default_flush_timeout()))?;
/// .spawn_opts(&re_sdk::SpawnOptions::default(), re_sdk::default_flush_timeout())?;
/// # Ok::<(), Box<dyn std::error::Error>>(())
/// ```
pub fn spawn_opts(
Expand Down Expand Up @@ -1513,10 +1510,7 @@ impl RecordingStream {
/// terms of data durability and ordering.
/// See [`Self::set_sink`] for more information.
pub fn connect(&self) {
self.connect_opts(
crate::default_server_addr(),
Some(crate::default_flush_timeout()),
);
self.connect_opts(crate::default_server_addr(), crate::default_flush_timeout());
}

/// Swaps the underlying sink for a [`crate::log_sink::TcpSink`] sink pre-configured to use
Expand Down Expand Up @@ -1558,7 +1552,7 @@ impl RecordingStream {
/// terms of data durability and ordering.
/// See [`Self::set_sink`] for more information.
pub fn spawn(&self) -> RecordingStreamResult<()> {
self.spawn_opts(&Default::default(), Some(crate::default_flush_timeout()))
self.spawn_opts(&Default::default(), crate::default_flush_timeout())
}

/// Spawns a new Rerun Viewer process from an executable available in PATH, then swaps the
Expand Down
6 changes: 4 additions & 2 deletions crates/re_sdk_comms/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ pub fn default_server_addr() -> std::net::SocketAddr {
}

/// The default amount of time to wait for the TCP connection to resume during a flush
pub fn default_flush_timeout() -> std::time::Duration {
std::time::Duration::from_secs(2)
#[allow(clippy::unnecessary_wraps)]
pub fn default_flush_timeout() -> Option<std::time::Duration> {
// NOTE: This is part of the SDK and meant to be used where we accept `Option<std::time::Duration>` values.
Some(std::time::Duration::from_secs(2))
}
3 changes: 3 additions & 0 deletions crates/re_space_view_spatial/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
//!
//! Space Views that show entities in a 2D or 3D spatial relationship.
// TODO(#3408): remove unwrap()
#![allow(clippy::unwrap_used)]

mod contexts;
mod eye;
mod heuristics;
Expand Down
3 changes: 3 additions & 0 deletions crates/re_space_view_tensor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
//!
//! A Space View dedicated to visualizing tensors with arbitrary dimensionality.
// TODO(#3408): remove unwrap()
#![allow(clippy::unwrap_used)]

mod dimension_mapping;
mod space_view_class;
mod tensor_dimension_mapper;
Expand Down
3 changes: 3 additions & 0 deletions crates/re_space_view_time_series/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
//!
//! A Space View that shows plots over Rerun timelines.
// TODO(#3408): remove unwrap()
#![allow(clippy::unwrap_used)]

mod aggregation;
mod line_visualizer_system;
mod overrides;
Expand Down
3 changes: 3 additions & 0 deletions crates/re_time_panel/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
//! This crate provides a panel that shows allows to control time & timelines,
//! as well as all necessary ui elements that make it up.
// TODO(#3408): remove unwrap()
#![allow(clippy::unwrap_used)]

mod data_density_graph;
mod paint_ticks;
mod time_axis;
Expand Down
1 change: 1 addition & 0 deletions crates/re_types/src/components/half_sizes2d.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/re_types/src/components/half_sizes3d.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/re_types/src/components/line_strip2d.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/re_types/src/components/line_strip3d.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/re_types/src/components/pinhole_projection.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/re_types/src/components/position2d.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/re_types/src/components/position3d.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/re_types/src/components/range1d.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/re_types/src/components/resolution.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/re_types/src/components/texcoord2d.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/re_types/src/components/triangle_indices.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/re_types/src/components/vector2d.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/re_types/src/components/vector3d.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/re_types/src/components/view_coordinates.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/re_types/src/datatypes/mat3x3.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/re_types/src/datatypes/mat4x4.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e33895d

Please sign in to comment.