Skip to content

Use safe transmute by default #48

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:
- run: cargo hack check --all --ignore-private --each-feature --no-dev-deps
- run: cargo check --all --all-targets --all-features
- run: cargo test
# Test without zerocopy
- run: cargo test --no-default-features
- run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings

msrv:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.5.2

* Use safe transmutes from the zerocopy crate by default

## 0.5.1

* Add test to reproduce issue in `impl Stream for Entries` causing filename truncation by @charliermarsh in https://github.com/astral-sh/tokio-tar/pull/41
Expand Down
21 changes: 21 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ portable-atomic = "1"
rustc-hash = "2.1.0"
tokio = { version = "1", features = ["fs", "io-util", "rt"] }
tokio-stream = "0.1"
zerocopy = { version = "0.8.23", features = ["derive"], optional = true }

[dev-dependencies]
tempfile = "3"
Expand All @@ -40,7 +41,9 @@ xattr = { version = "1.0", optional = true }
libc = "0.2"

[features]
default = ["xattr"]
default = ["xattr", "zerocopy"]
# Use safe transmute for headers (otherwise, unsafe pointer casts are used)
zerocopy = ["dep:zerocopy"]

[lib]
name = "tokio_tar"
Loading