Skip to content

Commit

Permalink
Compilation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
slightlyoutofphase committed Mar 24, 2022
1 parent 8f7359a commit df7eed0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>"]
keywords = ["vec", "array", "no_std", "vector", "stack"]
categories = ["data-structures", "no-std"]
Expand Down
6 changes: 0 additions & 6 deletions src/iterators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<T>() == 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.
Expand Down
11 changes: 4 additions & 7 deletions src/string/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ impl<const N: usize> StaticString<N> {
/// ```
#[allow(clippy::should_implement_trait)]
#[inline(always)]
pub const fn from_str<S: ~const AsRef<str> + ~const Drop>(string: S) -> Self {
pub fn from_str<S: AsRef<str>>(string: S) -> Self {
let mut res = Self::new();
let string_ref = string.as_ref();
unsafe {
Expand Down Expand Up @@ -559,7 +559,7 @@ impl<const N: usize> StaticString<N> {
/// assert_eq!(s, "foobar");
/// ```
#[inline]
pub const fn push_str<S: ~const AsRef<str> + ~const Drop>(&mut self, string: S) {
pub fn push_str<S: AsRef<str>>(&mut self, string: S) {
// Note that when calling this at runtime, the compiler still just sees the signature
// as `push_str<S: AsRef<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
Expand Down Expand Up @@ -592,7 +592,7 @@ impl<const N: usize> StaticString<N> {
/// # }
/// ```
#[inline(always)]
pub const fn push_str_truncating<S: ~const AsRef<str> + ~const Drop>(&mut self, string: S) {
pub fn push_str_truncating<S: AsRef<str>>(&mut self, string: S) {
unsafe { self.push_str_unchecked(truncate_str(string.as_ref(), self.remaining_capacity())) };
}

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

0 comments on commit df7eed0

Please sign in to comment.