mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-22 12:37:32 +00:00
Inline to make OsStr::is_empty zero cost
This commit is contained in:
parent
f795e8a216
commit
137a31d692
@ -615,6 +615,7 @@ impl OsStr {
|
|||||||
/// assert!(!os_str.is_empty());
|
/// assert!(!os_str.is_empty());
|
||||||
/// ```
|
/// ```
|
||||||
#[stable(feature = "osstring_simple_functions", since = "1.9.0")]
|
#[stable(feature = "osstring_simple_functions", since = "1.9.0")]
|
||||||
|
#[inline]
|
||||||
pub fn is_empty(&self) -> bool {
|
pub fn is_empty(&self) -> bool {
|
||||||
self.inner.inner.is_empty()
|
self.inner.inner.is_empty()
|
||||||
}
|
}
|
||||||
|
@ -104,6 +104,7 @@ impl Buf {
|
|||||||
self.inner.shrink_to(min_capacity)
|
self.inner.shrink_to(min_capacity)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
pub fn as_slice(&self) -> &Slice {
|
pub fn as_slice(&self) -> &Slice {
|
||||||
unsafe { mem::transmute(&*self.inner) }
|
unsafe { mem::transmute(&*self.inner) }
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user