diff --git a/Cargo.toml b/Cargo.toml index 8712f64..b4d3c02 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ repository = "https://github.com/slightlyoutofphase/staticvec" documentation = "https://docs.rs/staticvec/" license = "MIT OR Apache-2.0" readme = "README.md" -version = "0.11.3" +version = "0.11.4" authors = ["SlightlyOutOfPhase "] keywords = ["vec", "array", "no_std", "vector", "stack"] categories = ["data-structures", "no-std"] diff --git a/src/iterators.rs b/src/iterators.rs index efbb757..f44919d 100644 --- a/src/iterators.rs +++ b/src/iterators.rs @@ -797,12 +797,6 @@ impl<'a, T: 'a + Debug, const N: usize> Debug for StaticVecDrain<'a, T, N> { impl<'a, T: 'a, const N: usize> Drop for StaticVecDrain<'a, T, N> { #[inline] fn drop(&mut self) { - // Handle ZST edge case - if size_of::() == 0 { - if self.iter.start.is_null() || self.iter.end.is_null() { - return; - } - } // Read out any remaining contents first. while let Some(_) = self.next() {} // Adjust the StaticVec that this StaticVecDrain was created from, if necessary. diff --git a/src/string/mod.rs b/src/string/mod.rs index f389d3d..acb87d5 100644 --- a/src/string/mod.rs +++ b/src/string/mod.rs @@ -111,7 +111,7 @@ impl StaticString { /// ``` #[allow(clippy::should_implement_trait)] #[inline(always)] - pub const fn from_str + ~const Drop>(string: S) -> Self { + pub fn from_str>(string: S) -> Self { let mut res = Self::new(); let string_ref = string.as_ref(); unsafe { @@ -559,7 +559,7 @@ impl StaticString { /// assert_eq!(s, "foobar"); /// ``` #[inline] - pub const fn push_str + ~const Drop>(&mut self, string: S) { + pub fn push_str>(&mut self, string: S) { // Note that when calling this at runtime, the compiler still just sees the signature // as `push_str>(&mut self, string: S)`. Adding new `~const` bounds is only // a "breaking change" if you add them to something that was *already* a `const fn`. Adding @@ -592,7 +592,7 @@ impl StaticString { /// # } /// ``` #[inline(always)] - pub const fn push_str_truncating + ~const Drop>(&mut self, string: S) { + pub fn push_str_truncating>(&mut self, string: S) { unsafe { self.push_str_unchecked(truncate_str(string.as_ref(), self.remaining_capacity())) }; } @@ -609,10 +609,7 @@ impl StaticString { /// assert!(s.try_push_str("0".repeat(300)).is_err()); /// ``` #[inline(always)] - pub const fn try_push_str + ~const Drop>( - &mut self, - string: S, - ) -> Result<(), CapacityError> { + pub fn try_push_str>(&mut self, string: S) -> Result<(), CapacityError> { let string_ref = string.as_ref(); let string_length = string_ref.len(); let old_length = self.vec.length;