simplify more, ret_deref -> has_deref
This commit is contained in:
parent
c0e4230bf5
commit
c3e1e7a947
3 changed files with 9 additions and 11 deletions
|
@ -1463,11 +1463,11 @@ impl<'tcx> Place<'tcx> {
|
|||
|
||||
/// If MirPhase >= Derefered and if projection contains Deref,
|
||||
/// It's guaranteed to be in the first place
|
||||
pub fn ret_deref(&self) -> Option<PlaceElem<'tcx>> {
|
||||
pub fn has_deref(&self) -> bool {
|
||||
if !self.projection.is_empty() && self.projection[0] == PlaceElem::Deref {
|
||||
return Some(self.projection[0]);
|
||||
true
|
||||
} else {
|
||||
None
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1545,11 +1545,11 @@ impl<'tcx> PlaceRef<'tcx> {
|
|||
|
||||
/// If MirPhase >= Derefered and if projection contains Deref,
|
||||
/// It's guaranteed to be in the first place
|
||||
pub fn ret_deref(&self) -> Option<PlaceElem<'tcx>> {
|
||||
pub fn has_deref(&self) -> bool {
|
||||
if !self.projection.is_empty() && self.projection[0] == PlaceElem::Deref {
|
||||
return Some(self.projection[0]);
|
||||
true
|
||||
} else {
|
||||
None
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue