Crates.io | totally-speedy-transmute |
lib.rs | totally-speedy-transmute |
version | 1.69.420 |
source | src |
created_at | 2021-06-23 04:05:36.772465 |
updated_at | 2021-06-23 04:05:36.772465 |
description | does safe things with your safe data |
homepage | |
repository | https://github.com/John2143/totally-speedy-transmute/ |
max_upload_size | |
id | 413762 |
size | 8,180 |
An evil spiritual successor to Totally Safe Transmute
Totally Speedy Transmute (TST) is a library providing a small, performance oriented, safe version of std::mem::transmute
.
TST is intended for:
Totally Safe Transmute
users looking for a windows-compatible alternative.#![forbid(unsafe_code)]
codebases who dislike their co-workers.TST's benefits:
doc_include
no_std
compatibleFor exotic use cases (such as FFI (just RIIR (lol))), or, if you just want to peel back the curtain, see safe!
.
Proof there is no unsafe:
$ grep unsafe
src/lib.rs
1:#![forbid(unsafe_code)]
safe/src/lib.rs
1:#![forbid(unsafe_code)]
$ cargo geiger
Compiling safe v0.1.0 (/Users/jschmidt/totally-speedy-transmute/safe)
Checking totally-speedy-transmute v0.1.0 (/Users/jschmidt/totally-speedy-transmute)
Finished dev [unoptimized + debuginfo] target(s) in 1.36s
Scanning done
Metric output format: x/y
x = unsafe code used by the build
y = total unsafe code found in the crate
Symbols:
🔒 = No `unsafe` usage found, declares #![forbid(unsafe_code)]
❓ = No `unsafe` usage found, missing #![forbid(unsafe_code)]
☢️ = `unsafe` usage found
Functions Expressions Impls Traits Methods Dependency
0/0 0/0 0/0 0/0 0/0 🔒 totally-speedy-transmute 0.1.0
0/0 0/0 0/0 0/0 0/0 🔒 └── safe 0.1.0
0/0 0/0 0/0 0/0 0/0
$ cargo t
Compiling totally-speedy-transmute v0.1.0 (/Users/jschmidt/totally-speedy-transmute)
Finished test [unoptimized + debuginfo] target(s) in 0.26s
Running unittests (target/debug/deps/totally_speedy_transmute-c545620424772de5)
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running tests/wat.rs (target/debug/deps/wat-527d75fb46642aee)
running 5 tests
test leek ... ok
test fast_vec ... ok
test oops_all_mutable ... ok
test safe ... ok
test transmute_u8 ... ok
test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Doc-tests totally-speedy-transmute
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
$ cargo t --release
Compiling totally-speedy-transmute v0.1.0 (/Users/jschmidt/totally-speedy-transmute)
Finished release [optimized] target(s) in 0.28s
Running unittests (target/release/deps/totally_speedy_transmute-5a097808724739b1)
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running tests/wat.rs (target/release/deps/wat-20a81a817034b78e)
running 5 tests
test leek ... ok
test fast_vec ... ok
test transmute_u8 ... ok
test safe ... ok
test oops_all_mutable ... ok
test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Doc-tests totally-speedy-transmute
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
$ pushd ~/cargo-osha/
$ cargo run -- ~/totally-speedy-transmute/**/*.rs
Finished dev [unoptimized + debuginfo] target(s) in 0.01s
Running `target/debug/cargo-osha /Users/jschmidt/totally-speedy-transmute/safe/src/lib.rs /Users/jschmidt/totally-speedy-transmute/src/lib.rs /Users/jschmidt/totally-speedy-transmute/tests/wat.rs`
Processing file /Users/jschmidt/totally-speedy-transmute/safe/src/lib.rs
Processing file /Users/jschmidt/totally-speedy-transmute/src/lib.rs
Processing file /Users/jschmidt/totally-speedy-transmute/tests/wat.rs
Unsafe functions: 0/10
Unsafe expressions: 0/42
Unsafe traits: 0/0
Unsafe methods: 0/0
Unsafe impls: 0/0
$ poopd
fish: Unknown command: poopd
$ popd