fast image operations
update
bendn 2025-02-04
parent 3dd76b4 · commit 1aafaa2
-rw-r--r--src/lib.rs3
-rw-r--r--src/term/b64.rs3
-rw-r--r--src/uninit.rs2
3 files changed, 3 insertions, 5 deletions
diff --git a/src/lib.rs b/src/lib.rs
index cd9a5b1..b0bc694 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -53,7 +53,6 @@
#![feature(
type_changing_struct_update,
maybe_uninit_write_slice,
- hint_assert_unchecked,
slice_swap_unchecked,
generic_const_exprs,
iter_array_chunks,
@@ -63,9 +62,7 @@
portable_simd,
array_windows,
doc_auto_cfg,
- const_option,
array_chunks,
- new_uninit,
iter_chain,
let_chains,
try_blocks,
diff --git a/src/term/b64.rs b/src/term/b64.rs
index a7f8226..2b0ae44 100644
--- a/src/term/b64.rs
+++ b/src/term/b64.rs
@@ -101,7 +101,7 @@ unsafe fn portable(mut input: &[u8], mut output: *mut u8) {
}
unsafe { encode_simple(input, output) };
}
-
+#[allow(dead_code)]
fn mulhi(x: u16x16, y: u16x16) -> u16x16 {
unsafe {
simd_cast::<_, u16x16>(
@@ -110,6 +110,7 @@ fn mulhi(x: u16x16, y: u16x16) -> u16x16 {
}
}
+#[allow(dead_code)]
fn mullo(x: u16x16, y: u16x16) -> u16x16 {
x * y
}
diff --git a/src/uninit.rs b/src/uninit.rs
index 82dadab..788f0fd 100644
--- a/src/uninit.rs
+++ b/src/uninit.rs
@@ -40,7 +40,7 @@ impl<T: Copy, const CHANNELS: usize> Image<T, CHANNELS> {
let dat = unsafe { self.slice(i) };
// SAFETY: caller
unsafe { assert_unchecked(dat.len() == data.len()) };
- MaybeUninit::copy_from_slice(dat, data);
+ dat.write_copy_of_slice(data);
}
/// Slice the image.