Skip to content

Commit

Permalink
MSRV fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
thomcc committed May 6, 2024
1 parent 1da9bd7 commit 9abe831
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
11 changes: 3 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,9 @@ jobs:
- build: win32-gnu
os: windows-2019
rust: stable-i686-gnu
# TODO: re-enable this I guess. I get inscrutable errors like
# `error reading from the zlib stream; class=Zlib (5)` in CI
# that don't repro locally, and I'm tired of getting an email
# about this every day.
#
# - build: msrv
# os: ubuntu-latest
# rust: "1.43.0"
- build: msrv
os: ubuntu-latest
rust: "1.57.0"
- build: beta
os: ubuntu-latest
rust: beta
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "arcstr"
version = "1.1.5"
rust-version = "1.57.0"
authors = ["Thom Chiovoloni <chiovolonit@gmail.com>"]
edition = "2021"
description = "A better reference-counted string type, with zero-cost (allocation-free) support for string literals, and reference counted substrings."
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![codecov](https://codecov.io/gh/thomcc/arcstr/branch/main/graph/badge.svg)](https://codecov.io/gh/thomcc/arcstr)
[![Docs](https://docs.rs/arcstr/badge.svg)](https://docs.rs/arcstr)
[![Latest Version](https://img.shields.io/crates/v/arcstr.svg)](https://crates.io/crates/arcstr)
![Minimum Rust Version](https://img.shields.io/badge/MSRV%201.43-blue.svg)
![Minimum Rust Version](https://img.shields.io/badge/MSRV%201.57-blue.svg)

This crate defines `ArcStr`, a reference counted string type. It's essentially trying to be a better `Arc<str>` or `Arc<String>`, at least for most use cases.

Expand Down
4 changes: 2 additions & 2 deletions src/arc_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ impl ArcStr {
/// `Self::has_static_lenflag`)
#[inline]
unsafe fn load_count_flag_raw(this: &Self, ord_if_needed: Ordering) -> PackedFlagUint {
PackedFlagUint::from_encoded(unsafe { (*this.0.as_ptr()).count_flag.load(ord_if_needed) })
PackedFlagUint::from_encoded((*this.0.as_ptr()).count_flag.load(ord_if_needed))
}

#[inline]
Expand Down Expand Up @@ -447,7 +447,7 @@ impl ArcStr {

#[inline]
unsafe fn to_static_unchecked(this: &Self) -> &'static str {
unsafe { &*Self::str_ptr(this) }
&*Self::str_ptr(this)
}

#[inline]
Expand Down
6 changes: 5 additions & 1 deletion src/mac.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ macro_rules! literal {
count_flag: $crate::_private::StaticArcStrInner::<[$crate::_private::u8; __TEXT.len()]>::STATIC_COUNT_VALUE,
// See comment for `_private::ConstPtrDeref` for what the hell's
// going on here.
data: __TEXT.as_ptr().cast::<[$crate::_private::u8; __TEXT.len()]>().read(),
data: *$crate::_private::ConstPtrDeref::<[$crate::_private::u8; __TEXT.len()]> {
p: __TEXT.as_ptr(),
}
.a,
// data: __TEXT.as_ptr().cast::<[$crate::_private::u8; __TEXT.len()]>().read(),
}
};
#[allow(clippy::declare_interior_mutable_const)]
Expand Down

0 comments on commit 9abe831

Please sign in to comment.