cargo: Fix some lack of knowledge of basic algebraic identities

This commit is contained in:
Patrick Walton 2012-08-30 10:39:28 -07:00
parent 45e46f5fc0
commit 9518fc79ea
3 changed files with 12 additions and 69 deletions

View file

@ -42,24 +42,9 @@ impl package : cmp::Ord {
if self.versions.lt(other.versions) { return true; }
return false;
}
pure fn le(&&other: package) -> bool {
if self.name.lt(other.name) { return true; }
if other.name.lt(self.name) { return false; }
if self.uuid.lt(other.uuid) { return true; }
if other.uuid.lt(self.uuid) { return false; }
if self.url.lt(other.url) { return true; }
if other.url.lt(self.url) { return false; }
if self.method.lt(other.method) { return true; }
if other.method.lt(self.method) { return false; }
if self.description.lt(other.description) { return true; }
if other.description.lt(self.description) { return false; }
if self.tags.lt(other.tags) { return true; }
if other.tags.lt(self.tags) { return false; }
if self.versions.le(other.versions) { return true; }
return false;
}
pure fn ge(&&other: package) -> bool { !other.lt(self) }
pure fn gt(&&other: package) -> bool { !other.le(self) }
pure fn le(&&other: package) -> bool { !other.lt(self) }
pure fn ge(&&other: package) -> bool { !self.lt(other) }
pure fn gt(&&other: package) -> bool { other.lt(self) }
}
type local_package = {