const generic expr based fixed length array manipulation crate
bendn 4 weeks ago
parent fd0a7b1 · commit 3888e1b
-rw-r--r--LICENSE2
-rw-r--r--src/lib.rs8
2 files changed, 4 insertions, 6 deletions
diff --git a/LICENSE b/LICENSE
index 2f002a4..8c33164 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2024 bendn
+Copyright (c) 2026 bendn
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/src/lib.rs b/src/lib.rs
index 5c5c658..f8d3212 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -11,7 +11,8 @@
iter_intersperse,
const_trait_impl,
maybe_uninit_array_assume_init,
- iter_map_windows
+ iter_map_windows,
+ const_precise_live_drops
)]
#![warn(
clippy::undocumented_unsafe_blocks,
@@ -64,10 +65,7 @@ impl<X, Y> Pair<X, Y> {
// SAFETY: we are a tuple!!!
unsafe { transmute_unchecked::<Self, (X, Y)>(self) }
} else {
- // SAFETY: this is safe.
- let out = unsafe { (core::ptr::read(&self.0), core::ptr::read(&self.1)) };
- core::mem::forget(self);
- out
+ (self.0, self.1)
}
}