Skip to content

Commit

Permalink
Auto merge of #219 - michaelwoerister:prepare-release-11.0.0, r=micha…
Browse files Browse the repository at this point in the history
…elwoerister

Prepare 11.0.0 release

The change here makes `StringId::new` and `StringId::new_virtual` backwards compatible with 10.x, so that we don't require unnecessary churn when updating to 11.0.0.
  • Loading branch information
bors committed Dec 18, 2023
2 parents 8193f4d + e15b537 commit f291450
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion analyzeme/src/testing_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ fn generate_profiling_data(
) -> Vec<Event<'static>> {
let profiler = Arc::new(Profiler::new(Path::new(filestem)).unwrap());

let event_id_virtual = EventId::from_label(StringId::new_virtual(42));
let event_id_virtual = EventId::from_label(StringId::new_virtual(42u64));
let event_id_builder = EventIdBuilder::new(&profiler);

let event_ids: Vec<(StringId, EventId)> = vec![
Expand Down
7 changes: 4 additions & 3 deletions measureme/src/stringtable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,13 @@ impl StringId {
pub const INVALID: StringId = StringId(INVALID_STRING_ID);

#[inline]
pub fn new(id: u64) -> StringId {
StringId(id)
pub fn new(id: impl Into<u64>) -> StringId {
StringId(id.into())
}

#[inline]
pub fn new_virtual(id: u64) -> StringId {
pub fn new_virtual(id: impl Into<u64>) -> StringId {
let id = id.into();
assert!(id <= MAX_USER_VIRTUAL_STRING_ID);
StringId(id)
}
Expand Down

0 comments on commit f291450

Please sign in to comment.