Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc #44

Merged
merged 7 commits into from
Feb 10, 2025
Merged

Misc #44

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,24 @@

Notable changes only.

## Unreleased
## [0.8.0] - 2025-02-10

### Added

- add `as_ptr` to strings.
- add `as_mut_ptr` and `as_mut_ptr_unchecked` to strings and bytes

### Changed

- improve feature testing in CI
- improve doc
- update some dev dependencies

### Fixed

- remove accidentally mandatory dependency to `serde`
- fix `bstr` feature in `no_std`
- fix some clippy lints

## [0.7.0] - 2025-01-10

Expand Down Expand Up @@ -46,7 +55,7 @@ Notable changes only.
- implement `core::error:Error` for custom errors, rather than
`std::error::Error` and bump msrv

### Fixe
### Fixed

- fix doc issue [#28](https://github.com/polazarus/hipstr/issues/28)
- fix MIRI check due to provenance loss
Expand Down Expand Up @@ -163,8 +172,9 @@ Most of those addition are breaking because they shadows `str`'s methods.

Initial release

<!-- [unreleased]: https://github.com/polazarus/hipstr/compare/0.7.0...HEAD -->
<!-- [unreleased]: https://github.com/polazarus/hipstr/compare/0.8.0...HEAD -->

[0.8.0]: https://github.com/polazarus/hipstr/compare/0.7.0...0.8.0
[0.7.0]: https://github.com/polazarus/hipstr/compare/0.6.0...0.7.0
[0.6.0]: https://github.com/polazarus/hipstr/compare/0.5.1...0.6.0
[0.5.1]: https://github.com/polazarus/hipstr/compare/0.5.0...0.5.1
Expand Down
19 changes: 7 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "hipstr"
version = "0.7.0"
version = "0.8.0"
authors = ["Polazarus <[email protected]>"]
description = """Yet another string for Rust: zero-cost borrow and slicing,
inline representation for small strings, (atomic) reference counting"""
Expand All @@ -17,23 +17,18 @@ all-features = true

[features]
default = ["std"]
std = ["serde/std"]
std = ["serde?/std"]
unstable = []
serde = ["dep:serde"]
bstr = ["dep:bstr"]
borsh = ["dep:borsh"]

[dev-dependencies]
fastrand = "2.0.0"
serde_test = "1.0.176"
serde = { version = "1.0.100", default-features = false, features = [
"derive",
"alloc",
] }
serde_json = { version = "1.0.45", default-features = false, features = [
"alloc",
] }
divan = "0.1.15"
fastrand = "2.3.0"
serde_test = "1.0.177"
serde = { version = "1.0.100", default-features = false, features = ["derive", "alloc"] }
serde_json = { version = "1.0.45", default-features = false, features = ["alloc"] }
divan = "0.1.17"

[dependencies.bstr]
version = "1.3"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ let _clone = simple_greetings.clone(); // no copy

let user = "John";
let greetings = HipStr::from(format!("Hello {}", user));
let user = greetings.slice(6..): // no copy
let user = greetings.slice(6..); // no copy
drop(greetings); // the slice is owned, it exists even if greetings disappear

let chars = user.chars().count(); // "inherits" `&str` methods
Expand Down Expand Up @@ -96,7 +96,7 @@ cross test --target i686-unknown-linux-gnu # 32-bit LE
cross test --target x86_64-unknown-linux-gnu # 64-bit LE
```

NB: previously I used MIPS targets for big endian, but due to some LLVM-related
Note: previously I used MIPS targets for big endian, but due to some LLVM-related
issue they are not working anymore… see
[Rust issue #113065](https://github.com/rust-lang/rust/issues/113065)

Expand Down
6 changes: 1 addition & 5 deletions src/backend.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
//! Sealed backend trait and the built-in implementations.

/// Shared (thread-safe) reference counted backend.
#[cfg(target_has_atomic = "ptr")]
pub use crate::smart::Arc;
/// Use a local reference counted backend.
pub use crate::smart::Rc;
/// Use a unique reference.
pub use crate::smart::Unique;
pub use crate::smart::{Rc, Unique};

#[deprecated(note = "renamed to Rc")]
pub type Local = crate::smart::Rc;
Expand Down
Loading