Skip to content
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
1 change: 1 addition & 0 deletions lib/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

### Patch

- Reserve the full length when building an encoding from a specification
- Clarify wrapping behavior on empty output in documentation
- Fix `redundant_explicit_links` rustdoc lint
- Rename lints in `Cargo.toml` to use underscores
Expand Down
4 changes: 3 additions & 1 deletion lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1983,7 +1983,9 @@ impl Specification {
check!(SpecificationError(Undefined(to[i])), v != INVALID);
set(&mut values, from[i], v)?;
}
let mut encoding = Vec::new();
// The implementation is 256 symbols, 256 values, padding, bit-order and bit-width, and
// optionally the wrap width and separator (or a zero width for ignore).
let mut encoding = Vec::with_capacity(515 + wrap.map_or(0, |(_, end)| end.len()));
for _ in 0 .. 256 / symbols.len() {
encoding.extend_from_slice(symbols);
}
Expand Down