Skip to content

Commit 5c4a072

Browse files
JOE1994Thomas Bahn
authored and
Thomas Bahn
committed
Mark AsciiString::new() as 'const fn'
Since 'Vec::new()' is already a const function, there is no difference in generated MIR/ASM whether 'AsciiString::new()' is marked 'const' or not. I saw issue #56 is waiting to mark this function as 'const', and so this PR simply marks 'AsciiString::new()' as a const fn. Thanks for reviewing this PR :)
1 parent b3f1333 commit 5c4a072

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ascii_string.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl AsciiString {
2626
/// let mut s = AsciiString::new();
2727
/// ```
2828
#[inline]
29-
pub fn new() -> Self {
29+
pub const fn new() -> Self {
3030
AsciiString { vec: Vec::new() }
3131
}
3232

0 commit comments

Comments
 (0)