Skip to content

Commit

Permalink
Mark std::as_bytes as inline
Browse files Browse the repository at this point in the history
This wasn't marked inline, so wasn't being inlined cross-crate. It's
actually a no-op function, since it's a wrapper around `mem::transmute`.
Marking it inline means that programs calling it can see that it's a
no-op and act accordingly during optimisation.
  • Loading branch information
Aatch committed Jun 5, 2015
1 parent e0ca6b1 commit beadbfd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/libcollections/str.rs
Expand Up @@ -1466,6 +1466,7 @@ impl str {
/// assert_eq!("bors".as_bytes(), b"bors");
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[inline(always)]
pub fn as_bytes(&self) -> &[u8] {
core_str::StrExt::as_bytes(&self[..])
}
Expand Down

0 comments on commit beadbfd

Please sign in to comment.