Skip to content

Commit

Permalink
Update rust-url to improve hash/cmp performance
Browse files Browse the repository at this point in the history
Both no longer require allocations!
  • Loading branch information
alexcrichton committed Jun 3, 2015
1 parent f916188 commit e5a870b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/cargo/core/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ impl Ord for SourceId {
ord => return ord,
}
}
self.inner.url.to_string().cmp(&other.inner.url.to_string())
self.inner.url.cmp(&other.inner.url)
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/cargo/sources/git/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,13 @@ mod test {
#[test]
pub fn test_url_to_path_ident_with_path() {
let ident = ident(&url("https://github.com/carlhuda/cargo"));
assert_eq!(ident, "cargo-51d6ede913e3e1d5");
assert!(ident.starts_with("cargo-"));
}

#[test]
pub fn test_url_to_path_ident_without_path() {
let ident = ident(&url("https://github.com"));
assert_eq!(ident, "_empty-eba8a1ec0f6907fb");
assert!(ident.starts_with("_empty-"));
}

#[test]
Expand Down

0 comments on commit e5a870b

Please sign in to comment.