Skip to content

Commit

Permalink
Fix clippy warning
Browse files Browse the repository at this point in the history
  • Loading branch information
jinleili committed Nov 6, 2024
1 parent 237d27f commit 0721603
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion simuverse/src/egui_lib/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pub(crate) fn show_code(ui: &mut egui::Ui, code: &str) {
let code = remove_leading_indentation(code.trim_start_matches('\n'));
let language = "rs";
let theme = egui_extras::syntax_highlighting::CodeTheme::from_memory(ui.ctx(), &ui.style());
let theme = egui_extras::syntax_highlighting::CodeTheme::from_memory(ui.ctx(), ui.style());
egui_extras::syntax_highlighting::code_view_ui(ui, &theme, &code, language);
}

Expand Down
6 changes: 1 addition & 5 deletions simuverse/src/field_simulator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@ impl FieldSimulator {
canvas_size.y / pixel_distance,
);

let field_workgroup_count = (
(field_size.x + 15) / 16,
(field_size.y + 15) / 16,
1,
);
let field_workgroup_count = ((field_size.x + 15) / 16, (field_size.y + 15) / 16, 1);
let (_, sx, sy) = crate::util::matrix_helper::fullscreen_factor(
(canvas_size.x as f32, canvas_size.y as f32).into(),
75.0 / 180.0 * std::f32::consts::PI,
Expand Down
6 changes: 3 additions & 3 deletions simuverse/src/setting/control_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,20 +268,20 @@ impl ControlPanel {
ui.selectable_value(&mut self.selected_code_snippet, Some(3), "黑洞");
});

let theme = egui_extras::syntax_highlighting::CodeTheme::from_memory(ui.ctx(), &ui.style());
let theme = egui_extras::syntax_highlighting::CodeTheme::from_memory(ui.ctx(), ui.style());

let mut layouter = |ui: &egui::Ui, string: &str, wrap_width: f32| {
let mut layout_job = egui_extras::syntax_highlighting::highlight(
ui.ctx(),
&ui.style(),
ui.style(),
&theme,
&crate::remove_leading_indentation(string),
"rs",
);
layout_job.wrap.max_width = wrap_width;
ui.fonts(|f| f.layout_job(layout_job))
};
let theme = egui_extras::syntax_highlighting::CodeTheme::from_memory(ui.ctx(), &ui.style());
let theme = egui_extras::syntax_highlighting::CodeTheme::from_memory(ui.ctx(), ui.style());
egui_extras::syntax_highlighting::code_view_ui(
ui,
&theme,
Expand Down
1 change: 1 addition & 0 deletions simuverse/src/truck/platform/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ pub struct Scene {
#[derive(Debug, Clone)]
pub struct DeviceHandler {
pub device: Arc<Device>,
#[allow(dead_code)]
pub queue: Arc<Queue>,
}

Expand Down

0 comments on commit 0721603

Please sign in to comment.