Use matches! for YieldSource::is_await

This commit is contained in:
Wei Liu 2022-05-06 15:00:48 +00:00
parent 85e688e4c3
commit fcb385cfb1
1 changed files with 1 additions and 4 deletions

View File

@ -2078,10 +2078,7 @@ pub enum YieldSource {
impl YieldSource {
pub fn is_await(&self) -> bool {
match self {
YieldSource::Await { .. } => true,
YieldSource::Yield => false,
}
matches!(self, YieldSource::Await { .. })
}
}