Skip to content

Commit

Permalink
Increase MSRV to 1.74.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dylni committed Nov 4, 2023
1 parent a75032f commit 6870f75
Show file tree
Hide file tree
Showing 12 changed files with 629 additions and 995 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: build

env:
OS_STR_BYTES_CHECKED_CONVERSIONS: 1
OS_STR_BYTES_NIGHTLY: 1

on:
pull_request:
Expand All @@ -27,7 +26,7 @@ jobs:
cargo fmt --check
shell: bash
env:
cargo_hack_options: --feature-powerset --optional-deps --exclude-features nightly
cargo_hack_options: --feature-powerset --optional-deps
timeout-minutes: 10
strategy:
matrix:
Expand All @@ -38,7 +37,6 @@ jobs:
steps:
- uses: dylni/build-actions/build-other@master
with:
nightly-features: 'nightly print_bytes uniquote'
target: ${{ matrix.target }}
version: ${{ matrix.version }}
timeout-minutes: 10
Expand All @@ -55,7 +53,6 @@ jobs:
steps:
- uses: dylni/build-actions/test@master
with:
nightly-features: 'nightly print_bytes uniquote'
version: ${{ matrix.version }}
- run: cargo test --no-default-features --features raw_os_str
timeout-minutes: 10
Expand Down
4 changes: 1 addition & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "os_str_bytes"
version = "6.6.1"
authors = ["dylni"]
edition = "2021"
rust-version = "1.61.0"
rust-version = "1.74.0"
description = """
Convert between byte sequences and platform-native strings
"""
Expand Down Expand Up @@ -31,8 +31,6 @@ lazy_static = "1.4"
[features]
default = ["memchr", "raw_os_str"]

nightly = []

checked_conversions = ["conversions"]
conversions = []
raw_os_str = []
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,32 +47,32 @@ The minimum supported Rust toolchain version depends on the platform:
<tr>
<td>SOLID</td>
<td><code>*-*-solid_asp3(-*)</code></td>
<td>1.61.0</td>
<td>1.74.0</td>
</tr>
<tr>
<td>Unix</td>
<td>Unix</td>
<td>1.61.0</td>
<td>1.74.0</td>
</tr>
<tr>
<td>WASI</td>
<td><code>*-wasi</code></td>
<td>1.61.0</td>
<td>1.74.0</td>
</tr>
<tr>
<td>WebAssembly</td>
<td><code>wasm32-*-unknown</code></td>
<td>1.61.0</td>
<td>1.74.0</td>
</tr>
<tr>
<td>Windows</td>
<td><code>*-*-windows-*</code></td>
<td>1.61.0</td>
<td>1.74.0</td>
</tr>
<tr>
<td>Xous</td>
<td><code>*-*-xous-*</code></td>
<td>1.74 (rust-lang/rust#104101)</td>
<td>1.74.0</td>
</tr>
</table>

Expand Down
42 changes: 2 additions & 40 deletions src/common/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,6 @@ use std::fmt::Formatter;

use crate::RawOsStr;

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

if_not_nightly! {
#[inline(always)]
pub(crate) const fn is_continuation(_: u8) -> bool {
false
}
}

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

if_not_nightly! {
#[inline(always)]
pub(crate) fn decode_code_point(_: &[u8]) -> u32 {
unreachable!();
}
}

if_conversions! {
pub(crate) fn ends_with(string: &[u8], suffix: &[u8]) -> bool {
string.ends_with(suffix)
Expand All @@ -44,17 +15,8 @@ if_conversions! {
}
}

fn as_inner(string: &RawOsStr) -> &[u8] {
if_nightly_return! {
{
string.as_encoded_bytes()
}
string.as_raw_bytes()
}
}

pub(crate) fn debug(string: &RawOsStr, f: &mut Formatter<'_>) -> fmt::Result {
for byte in as_inner(string) {
for byte in string.as_encoded_bytes() {
write!(f, "\\x{:02X}", byte)?;
}
Ok(())
Expand All @@ -69,6 +31,6 @@ pub(crate) mod uniquote {
use crate::RawOsStr;

pub(crate) fn escape(string: &RawOsStr, f: &mut Formatter<'_>) -> Result {
super::as_inner(string).escape(f)
string.as_encoded_bytes().escape(f)
}
}
Loading

0 comments on commit 6870f75

Please sign in to comment.