Use cmp of Self in implementaions of partial_cmp (#8559)
				
					
				
			# Objective Ensure future consistency between the two compare functions for all types with manual `Ord` and `PartialOrd` implementations. ## Solution Use `Self::cpm` in the implementation of `partial_cpm` for types `Handle` and `Name`.
This commit is contained in:
		
							parent
							
								
									d319910d36
								
							
						
					
					
						commit
						1530f63756
					
				@ -279,7 +279,7 @@ impl<T: Asset> Eq for Handle<T> {}
 | 
			
		||||
 | 
			
		||||
impl<T: Asset> PartialOrd for Handle<T> {
 | 
			
		||||
    fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
 | 
			
		||||
        Some(self.id.cmp(&other.id))
 | 
			
		||||
        Some(self.cmp(other))
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -177,7 +177,7 @@ impl Eq for Name {}
 | 
			
		||||
 | 
			
		||||
impl PartialOrd for Name {
 | 
			
		||||
    fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
 | 
			
		||||
        self.name.partial_cmp(&other.name)
 | 
			
		||||
        Some(self.cmp(other))
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user