Skip to content

Commit

Permalink
misc. fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
joseluis committed Feb 12, 2025
1 parent f26bc08 commit 1bf2809
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
14 changes: 0 additions & 14 deletions src/sys/mem/size/byte.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,3 @@ pub trait ByteSized: Sized {
Ptr::size_ratio(Self::BYTE_SIZE)
}
}

/// Returns the rounded up size in bytes from a size in bits.
///
/// This is equivalent to `(bit_size + 7) / 8` but handles potential overflow.
#[must_use]
pub const fn bytes_from_bits(bit_size: usize) -> usize {
if let Some(t) = bit_size.checked_add(8 - 1) {
t / 8
} else {
bytes_from_bits_cold()
}
}
#[cold] #[rustfmt::skip]
const fn bytes_from_bits_cold() -> usize { usize::MAX / 8 }
2 changes: 1 addition & 1 deletion src/ui/back/miniquad/pixels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ impl EventHandler for MiniquadPixels {
}
}

use shader::{shader_meta, FRAGMENT, METAL, VERTEX};
use shader::{shader_meta, FRAGMENT, VERTEX};
mod shader {
use crate::{vec_ as vec, ToString};
use ::miniquad::{ShaderMeta, UniformBlockLayout};
Expand Down

0 comments on commit 1bf2809

Please sign in to comment.