Skip to content

Commit

Permalink
Remove deprecated items
Browse files Browse the repository at this point in the history
  • Loading branch information
dylni committed Nov 4, 2023
1 parent 7611c39 commit c029809
Show file tree
Hide file tree
Showing 6 changed files with 179 additions and 557 deletions.
36 changes: 22 additions & 14 deletions src/common/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ use std::fmt::Formatter;
use crate::RawOsStr;

if_not_nightly! {
use super::Result;
if_conversions! {
use super::Result;
}
}

if_not_nightly! {
Expand All @@ -15,9 +17,11 @@ if_not_nightly! {
}

if_not_nightly! {
#[inline(always)]
pub(crate) fn validate_bytes(_: &[u8]) -> Result<()> {
Ok(())
if_conversions! {
#[inline(always)]
pub(crate) fn validate_bytes(_: &[u8]) -> Result<()> {
Ok(())
}
}
}

Expand All @@ -28,21 +32,25 @@ if_not_nightly! {
}
}

pub(crate) fn ends_with(string: &[u8], suffix: &[u8]) -> bool {
string.ends_with(suffix)
if_conversions! {
pub(crate) fn ends_with(string: &[u8], suffix: &[u8]) -> bool {
string.ends_with(suffix)
}
}

pub(crate) fn starts_with(string: &[u8], prefix: &[u8]) -> bool {
string.starts_with(prefix)
if_conversions! {
pub(crate) fn starts_with(string: &[u8], prefix: &[u8]) -> bool {
string.starts_with(prefix)
}
}

#[allow(deprecated)]
#[cfg_attr(feature = "nightly", allow(unreachable_code))]
fn as_inner(string: &RawOsStr) -> &[u8] {
if_nightly_return! {{
string.as_encoded_bytes()
}}
string.as_raw_bytes()
if_nightly_return! {
{
string.as_encoded_bytes()
}
string.as_raw_bytes()
}
}

pub(crate) fn debug(string: &RawOsStr, f: &mut Formatter<'_>) -> fmt::Result {
Expand Down
Loading

0 comments on commit c029809

Please sign in to comment.