Skip to content

Commit

Permalink
Fix some clippy problems
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Nov 19, 2024
1 parent 0164ca2 commit d60bc09
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion crates/build/re_types_builder/src/codegen/fbs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ impl FbsCodeGenerator {
}

fn add_include_for(
&mut self,
&self,
reporter: &crate::Reporter,
files_to_write: &mut std::collections::BTreeMap<Utf8PathBuf, String>,
directory: &str,
Expand Down
2 changes: 1 addition & 1 deletion crates/store/re_entity_db/src/entity_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ impl IngestionStatistics {
}
}

fn on_new_row_id(&mut self, row_id: RowId) {
fn on_new_row_id(&self, row_id: RowId) {
if let Ok(duration_since_epoch) = web_time::SystemTime::UNIX_EPOCH.elapsed() {
let nanos_since_epoch = duration_since_epoch.as_nanos() as u64;

Expand Down
2 changes: 1 addition & 1 deletion crates/store/re_video/src/decode/ffmpeg_h264/ffmpeg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ impl FFmpegProcessAndListener {
}
}

fn end_of_video(&mut self) {
fn end_of_video(&self) {
// Close stdin. That will let ffmpeg know that it should flush its buffers.
self.frame_data_tx.send(FFmpegFrameData::Quit).ok();
}
Expand Down
2 changes: 1 addition & 1 deletion crates/utils/re_case/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub fn to_snake_case(s: &str) -> String {
.replace("UVec", "uvec")
.replace("DVec", "dvec")
.replace("UInt", "uint");
*last = rerun_snake.convert(&last);
*last = rerun_snake.convert(last);
}
parts.join(".")
}
Expand Down
4 changes: 2 additions & 2 deletions crates/viewer/re_renderer/src/video/chunk_decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ impl VideoChunkDecoder {
/// Returns [`VideoPlayerError::EmptyBuffer`] if the internal buffer is empty,
/// which it is just after startup or after a call to [`Self::reset`].
pub fn update_video_texture(
&mut self,
&self,
render_ctx: &RenderContext,
video_texture: &mut VideoTexture,
presentation_timestamp: Time,
Expand Down Expand Up @@ -168,7 +168,7 @@ impl VideoChunkDecoder {
}

/// Return and clear the latest error that happened during decoding.
pub fn take_error(&mut self) -> Option<TimedDecodingError> {
pub fn take_error(&self) -> Option<TimedDecodingError> {
self.decoder_output.lock().error.take()
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/viewer/re_renderer_examples/multiview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ fn handle_incoming_screenshots(re_ctx: &RenderContext) {

impl Multiview {
fn draw_view<D: 'static + re_renderer::renderer::DrawData + Sync + Send + Clone>(
&mut self,
&self,
re_ctx: &RenderContext,
target_cfg: TargetConfiguration,
skybox: GenericSkyboxDrawData,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ impl SelectionHistoryUi {

#[allow(clippy::unused_self)]
fn history_item_ui(
&mut self,
&self,
blueprint: &ViewportBlueprint,
ui: &mut egui::Ui,
index: usize,
Expand Down
2 changes: 1 addition & 1 deletion crates/viewer/re_time_panel/src/time_control_ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ You can also define your own timelines, e.g. for sensor time or camera frame num
}

#[allow(clippy::unused_self)]
fn loop_button_ui(&mut self, time_control: &mut TimeControl, ui: &mut egui::Ui) {
fn loop_button_ui(&self, time_control: &mut TimeControl, ui: &mut egui::Ui) {
let icon = &re_ui::icons::LOOP;

ui.scope(|ui| {
Expand Down
2 changes: 1 addition & 1 deletion crates/viewer/re_ui/src/modal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ impl Modal {
///
/// Typically called by [`ModalHandler::ui`].
pub fn ui<R>(
&mut self,
&self,
ctx: &egui::Context,
content_ui: impl FnOnce(&mut egui::Ui, &mut bool) -> R,
) -> ModalResponse<R> {
Expand Down
2 changes: 1 addition & 1 deletion crates/viewer/re_viewer/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ impl App {
});
}

fn egui_debug_panel_ui(&mut self, ui: &mut egui::Ui) {
fn egui_debug_panel_ui(&self, ui: &mut egui::Ui) {
let egui_ctx = ui.ctx().clone();

egui::SidePanel::left("style_panel")
Expand Down
2 changes: 1 addition & 1 deletion crates/viewer/re_viewer/src/ui/rerun_menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ impl App {
}
}

fn save_buttons_ui(&mut self, ui: &mut egui::Ui, store_ctx: Option<&StoreContext<'_>>) {
fn save_buttons_ui(&self, ui: &mut egui::Ui, store_ctx: Option<&StoreContext<'_>>) {
use re_ui::UICommandSender;

let file_save_in_progress = self.background_tasks.is_file_save_in_progress();
Expand Down

0 comments on commit d60bc09

Please sign in to comment.