Skip to content

Commit cc850ec

Browse files
committed
Add #[inline] to {&str, &mut str}::default.
1 parent 76daca2 commit cc850ec

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

library/core/src/str/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -2431,6 +2431,7 @@ impl AsRef<[u8]> for str {
24312431
#[stable(feature = "rust1", since = "1.0.0")]
24322432
impl Default for &str {
24332433
/// Creates an empty str
2434+
#[inline]
24342435
fn default() -> Self {
24352436
""
24362437
}
@@ -2439,6 +2440,7 @@ impl Default for &str {
24392440
#[stable(feature = "default_mut_str", since = "1.28.0")]
24402441
impl Default for &mut str {
24412442
/// Creates an empty mutable str
2443+
#[inline]
24422444
fn default() -> Self {
24432445
// SAFETY: The empty string is valid UTF-8.
24442446
unsafe { from_utf8_unchecked_mut(&mut []) }

0 commit comments

Comments
 (0)