# expand
[](https://crates.io/crates/expand)
[](https://libraries.io/cargo/expand)
[](https://www.mozilla.org/en-US/MPL/2.0)
[](https://github.com/figsoda/expand/actions?query=workflow:ci)
Macro to expand byte string literals
## Usage
```rust
use expand::expand;
assert_eq!(
&expand!([@b"Hello,", b' ', @b"world", b'!']),
b"Hello, world!"
);
if let expand!([@b"patt", x, y, b'n', ..]) = b"pattern matching" {
assert_eq!(x, &b'e');
assert_eq!(y, &b'r');
} else {
panic!("pattern matching failed");
}
if let expand!([@b"msg = \"", xs @ .., b'"']) = br#"msg = "Hello, world!""# {
assert_eq!(xs, b"Hello, world!");
} else {
panic!("pattern matching failed");
}
```
## Changelog
See [CHANGELOG.md](https://github.com/figsoda/expand/blob/main/CHANGELOG.md)