Rollup merge of #92022 - woodenarrow:br_expected_bool, r=estebank
Eliminate duplicate codes of expected_found_bool The function expected_found_bool is the same as ExpectedFound::new. So use ExpectedFound::new to replace expected_found_bool to eliminate duplicate codes. 
This commit is contained in:
@@ -836,13 +836,5 @@ pub fn expected_found<R, T>(relation: &mut R, a: T, b: T) -> ExpectedFound<T>
|
||||
where
|
||||
R: TypeRelation<'tcx>,
|
||||
{
|
||||
expected_found_bool(relation.a_is_expected(), a, b)
|
||||
}
|
||||
|
||||
pub fn expected_found_bool<T>(a_is_expected: bool, a: T, b: T) -> ExpectedFound<T> {
|
||||
if a_is_expected {
|
||||
ExpectedFound { expected: a, found: b }
|
||||
} else {
|
||||
ExpectedFound { expected: b, found: a }
|
||||
}
|
||||
ExpectedFound::new(relation.a_is_expected(), a, b)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user