Skip to content

Commit

Permalink
std_unicode: Use #[inline] on the split_whitespace predicates
Browse files Browse the repository at this point in the history
  • Loading branch information
bluss committed Apr 30, 2017
1 parent f41ecef commit 41aeb9d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/libstd_unicode/u_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,14 @@ struct IsWhitespace;
impl FnOnce<(char, )> for IsWhitespace {
type Output = bool;

#[inline]
extern "rust-call" fn call_once(mut self, arg: (char, )) -> bool {
self.call_mut(arg)
}
}

impl FnMut<(char, )> for IsWhitespace {
#[inline]
extern "rust-call" fn call_mut(&mut self, arg: (char, )) -> bool {
arg.0.is_whitespace()
}
Expand All @@ -153,12 +155,14 @@ struct IsNotEmpty;
impl<'a, 'b> FnOnce<(&'a &'b str, )> for IsNotEmpty {
type Output = bool;

#[inline]
extern "rust-call" fn call_once(mut self, arg: (&&str, )) -> bool {
self.call_mut(arg)
}
}

impl<'a, 'b> FnMut<(&'a &'b str, )> for IsNotEmpty {
#[inline]
extern "rust-call" fn call_mut(&mut self, arg: (&&str, )) -> bool {
!arg.0.is_empty()
}
Expand Down

0 comments on commit 41aeb9d

Please sign in to comment.