git2-rs
git2-rs copied to clipboard
(Breaking Changes) Re-implement tracing wrapper in a safer way, replacing the use of `&str` with `&[u8]`.
This changes the type signature of TracingCb to use a &[u8] over an &str, leaving the conversion to the consumer as planned. This is a breaking change and will require a new release.
Internally, this replaces the use of a static AtomicUsize to store the tracing subscriber with a AtomicPtr. This is still unsafe, but lets us avoid the integer to pointer transmutation that was previously happening which is more explicitly a possible violation of Rust's memory model. Now all the casts and transmutations in tracing.rs are between pointer types, which is (relatively) safer.