Skip to content

Commit

Permalink
clippy stop yelling at me
Browse files Browse the repository at this point in the history
  • Loading branch information
sanbox-irl committed Feb 10, 2022
1 parent 69fb34f commit 32cf2b9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions imgui-examples/examples/support/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,10 @@ impl System {
gl_window.window().request_redraw();
}
Event::RedrawRequested(_) => {
let mut ui = imgui.frame();
let ui = imgui.frame();

let mut run = true;
run_ui(&mut run, &mut ui);
run_ui(&mut run, ui);
if !run {
*control_flow = ControlFlow::Exit;
}
Expand Down
8 changes: 8 additions & 0 deletions imgui/src/internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ pub trait RawWrapper {
}

/// Casting from/to a raw type that has the same layout and alignment as the target type
///
/// # Safety
///
/// Each function outlines its own safety contract, which generally is
/// that the cast from `T` to `Self` is valid.
pub unsafe trait RawCast<T>: Sized {
/// Casts an immutable reference from the raw type
///
Expand Down Expand Up @@ -124,6 +129,9 @@ pub enum DataType {
///
/// If this trait is implemented for a type, it is assumed to have *exactly* the same
/// representation in memory as the primitive value described by the associated `KIND` constant.
///
/// # Safety
/// The `DataType` *must* have the same representation as the primitive value of `KIND`.
pub unsafe trait DataTypeKind: Copy {
const KIND: DataType;
}
Expand Down
2 changes: 1 addition & 1 deletion imgui/src/tables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ pub struct Specs<'a>(&'a [sys::ImGuiTableColumnSortSpecs]);

impl<'a> Specs<'a> {
pub fn iter(self) -> impl Iterator<Item = TableColumnSortSpecs<'a>> {
self.0.iter().map(|v| TableColumnSortSpecs(v))
self.0.iter().map(TableColumnSortSpecs)
}
}

Expand Down

0 comments on commit 32cf2b9

Please sign in to comment.