Skip to content

Commit

Permalink
Don't allocate in SourceId::is_default_registry
Browse files Browse the repository at this point in the history
This gets called quite a lot and doesn't need to allocate in the first
place!
  • Loading branch information
alexcrichton committed May 3, 2019
1 parent 8258ca4 commit c7e1b68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cargo/core/source/source_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ impl SourceId {
Kind::Registry => {}
_ => return false,
}
self.inner.url.to_string() == CRATES_IO_INDEX
self.inner.url.as_str() == CRATES_IO_INDEX
}

/// Hashes `self`.
Expand Down

0 comments on commit c7e1b68

Please sign in to comment.