Skip to content

Commit df7eed0

Browse files
Compilation fixes
1 parent 8f7359a commit df7eed0

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ repository = "https://github.com/slightlyoutofphase/staticvec"
55
documentation = "https://docs.rs/staticvec/"
66
license = "MIT OR Apache-2.0"
77
readme = "README.md"
8-
version = "0.11.3"
8+
version = "0.11.4"
99
authors = ["SlightlyOutOfPhase <[email protected]>"]
1010
keywords = ["vec", "array", "no_std", "vector", "stack"]
1111
categories = ["data-structures", "no-std"]

src/iterators.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -797,12 +797,6 @@ impl<'a, T: 'a + Debug, const N: usize> Debug for StaticVecDrain<'a, T, N> {
797797
impl<'a, T: 'a, const N: usize> Drop for StaticVecDrain<'a, T, N> {
798798
#[inline]
799799
fn drop(&mut self) {
800-
// Handle ZST edge case
801-
if size_of::<T>() == 0 {
802-
if self.iter.start.is_null() || self.iter.end.is_null() {
803-
return;
804-
}
805-
}
806800
// Read out any remaining contents first.
807801
while let Some(_) = self.next() {}
808802
// Adjust the StaticVec that this StaticVecDrain was created from, if necessary.

src/string/mod.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ impl<const N: usize> StaticString<N> {
111111
/// ```
112112
#[allow(clippy::should_implement_trait)]
113113
#[inline(always)]
114-
pub const fn from_str<S: ~const AsRef<str> + ~const Drop>(string: S) -> Self {
114+
pub fn from_str<S: AsRef<str>>(string: S) -> Self {
115115
let mut res = Self::new();
116116
let string_ref = string.as_ref();
117117
unsafe {
@@ -559,7 +559,7 @@ impl<const N: usize> StaticString<N> {
559559
/// assert_eq!(s, "foobar");
560560
/// ```
561561
#[inline]
562-
pub const fn push_str<S: ~const AsRef<str> + ~const Drop>(&mut self, string: S) {
562+
pub fn push_str<S: AsRef<str>>(&mut self, string: S) {
563563
// Note that when calling this at runtime, the compiler still just sees the signature
564564
// as `push_str<S: AsRef<str>>(&mut self, string: S)`. Adding new `~const` bounds is only
565565
// a "breaking change" if you add them to something that was *already* a `const fn`. Adding
@@ -592,7 +592,7 @@ impl<const N: usize> StaticString<N> {
592592
/// # }
593593
/// ```
594594
#[inline(always)]
595-
pub const fn push_str_truncating<S: ~const AsRef<str> + ~const Drop>(&mut self, string: S) {
595+
pub fn push_str_truncating<S: AsRef<str>>(&mut self, string: S) {
596596
unsafe { self.push_str_unchecked(truncate_str(string.as_ref(), self.remaining_capacity())) };
597597
}
598598

@@ -609,10 +609,7 @@ impl<const N: usize> StaticString<N> {
609609
/// assert!(s.try_push_str("0".repeat(300)).is_err());
610610
/// ```
611611
#[inline(always)]
612-
pub const fn try_push_str<S: ~const AsRef<str> + ~const Drop>(
613-
&mut self,
614-
string: S,
615-
) -> Result<(), CapacityError<N>> {
612+
pub fn try_push_str<S: AsRef<str>>(&mut self, string: S) -> Result<(), CapacityError<N>> {
616613
let string_ref = string.as_ref();
617614
let string_length = string_ref.len();
618615
let old_length = self.vec.length;

0 commit comments

Comments
 (0)