Skip to content

Commit 31316c7

Browse files
tormolThomas Bahn
authored andcommitted
Mark AsciiStr and AsciiString #[repr(transparent)]
1 parent ce4dea2 commit 31316c7

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/ascii_str.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ use ascii_string::AsciiString;
2020
/// It can be created by a checked conversion from a `str` or `[u8]`, or borrowed from an
2121
/// `AsciiString`.
2222
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash)]
23+
#[repr(transparent)]
2324
pub struct AsciiStr {
2425
slice: [AsciiChar],
2526
}

src/ascii_string.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use ascii_str::{AsciiStr, AsAsciiStr, AsAsciiStrError};
1414

1515
/// A growable string stored as an ASCII encoded buffer.
1616
#[derive(Clone, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
17+
#[repr(transparent)]
1718
pub struct AsciiString {
1819
vec: Vec<AsciiChar>,
1920
}

0 commit comments

Comments
 (0)