Skip to content

Fix UB and a lot of small emprovements #1

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 10 commits into
base: master
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
8 changes: 7 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "byte_string"
version = "1.0.0"
version = "1.1.0"
edition = "2018"
authors = ["Francis Gagné <[email protected]>"]
description = "Wrapper types for outputting byte strings (b\"Hello\") using the Debug ({:?}) format."
documentation = "https://docs.rs/byte_string/"
Expand All @@ -11,3 +12,8 @@ license = "MIT/Apache-2.0"
exclude = [".travis.yml"]

[dependencies]
ref-cast = "1.0.3"

[features]
default = ["std"]
std = []
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# byte_string [![Build Status](https://travis-ci.org/FraGag/byte_string.svg?branch=master)](https://travis-ci.org/FraGag/byte_string)

The `byte_string` crate provides two types: `ByteStr` and `ByteString`.
Both types provide a `Debug` implementation
that outputs the slice using the Rust byte string syntax.
`ByteStr` wraps a byte slice (`[u8]`).
The `byte_string` crate provides two types: `ByteStr` and `ByteString`.
Both types provide a `Debug` implementation
that outputs the slice using the Rust byte string syntax
and a `Display` implementation with similar output, but without b"".
`ByteStr` wraps a byte slice (`[u8]`).
`ByteString` wraps a vector of bytes (`Vec<u8>`).

For example:

```rust
extern crate byte_string;

use byte_string::ByteStr;

fn main() {
Expand All @@ -31,6 +30,11 @@ prefer exposing the underlying slice or vector instead.
However, `ByteStr` and `ByteString` implement many traits, including derivable traits,
which makes them suitable for use as a private member of a struct or enum.

## `no_std` support

When built without default features (namely `std`) this crate supports `#![no_std]`
(though note that `ByteString` is supported only with `std` feature).

## License

<b>byte_string</b> is licensed
Expand Down
Loading