Skip to content

Commit

Permalink
cargo fmt fix
Browse files Browse the repository at this point in the history
  • Loading branch information
not-fl3 committed Jul 21, 2024
1 parent a19dfc4 commit 7efc7d5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/quad_gl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,12 @@ impl QuadGl {
.get_quad_pipeline_mut(pipeline)
.set_uniform(name, uniform);
}
pub fn set_uniform_array<T: ToBytes>(&mut self, pipeline: GlPipeline, name: &str, uniform: &[T]) {
pub fn set_uniform_array<T: ToBytes>(
&mut self,
pipeline: GlPipeline,
name: &str,
uniform: &[T],
) {
self.state.break_batching = true;

self.pipelines
Expand Down
7 changes: 6 additions & 1 deletion src/tobytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ impl<T: ToBytes, const N: usize> ToBytes for &[T; N] {

impl<T: ToBytes> ToBytes for &[T] {
fn to_bytes(&self) -> &[u8] {
unsafe { std::slice::from_raw_parts(self.as_ptr() as *const _ as *const u8, std::mem::size_of::<T>() * self.len()) }
unsafe {
std::slice::from_raw_parts(
self.as_ptr() as *const _ as *const u8,
std::mem::size_of::<T>() * self.len(),
)
}
}
}

0 comments on commit 7efc7d5

Please sign in to comment.