Skip to content

Commit a545e46

Browse files
authored
Merge pull request #69 from michaelwoerister/fix-warnings
Fix some warnings that prevent measureme being built as a path dependency of the compiler.
2 parents c8c27a9 + 5e0fee4 commit a545e46

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

measureme/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
//! [`StringId`]: struct.StringId.html
4848
//! [`TimestampKind`]: enum.TimestampKind.html
4949
50+
#![deny(warnings)]
51+
5052
mod event;
5153
mod file_header;
5254
#[cfg(any(not(target_arch = "wasm32"), target_os = "wasi"))]

measureme/src/profiler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::file_header::{write_file_header, FILE_MAGIC_EVENT_STREAM};
22
use crate::raw_event::{RawEvent, Timestamp, TimestampKind};
33
use crate::serialization::SerializationSink;
4-
use crate::stringtable::{METADATA_STRING_ID, SerializableString, StringId, StringTableBuilder};
4+
use crate::stringtable::{SerializableString, StringId, StringTableBuilder};
55
use std::error::Error;
66
use std::path::{Path, PathBuf};
77
use std::sync::Arc;

measureme/src/stringtable.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ pub struct StringTable {
265265
index: FxHashMap<StringId, Addr>,
266266
}
267267

268-
impl<'data> StringTable {
268+
impl StringTable {
269269
pub fn new(string_data: Vec<u8>, index_data: Vec<u8>) -> Result<StringTable, Box<dyn Error>> {
270270
let string_data_format = read_file_header(&string_data, FILE_MAGIC_STRINGTABLE_DATA)?;
271271
let index_data_format = read_file_header(&index_data, FILE_MAGIC_STRINGTABLE_INDEX)?;
@@ -292,7 +292,7 @@ impl<'data> StringTable {
292292
}
293293

294294
#[inline]
295-
pub fn get(&self, id: StringId) -> StringRef {
295+
pub fn get<'a>(&'a self, id: StringId) -> StringRef<'a> {
296296
StringRef { id, table: self }
297297
}
298298
}

measureme/src/testing_common.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ fn mk_filestem(file_name_stem: &str) -> PathBuf {
1717
}
1818

1919
// Generate some profiling data. This is the part that would run in rustc.
20-
fn generate_profiling_data<S: SerializationSink>(filestem: &Path) -> Vec<Event> {
20+
fn generate_profiling_data<S: SerializationSink>(filestem: &Path) -> Vec<Event<'static>> {
2121
let profiler = Arc::new(Profiler::<S>::new(Path::new(filestem)).unwrap());
2222

2323
let event_id_reserved = StringId::reserved(42);
@@ -83,7 +83,7 @@ fn generate_profiling_data<S: SerializationSink>(filestem: &Path) -> Vec<Event>
8383

8484
// Process some profiling data. This is the part that would run in a
8585
// post processing tool.
86-
fn process_profiling_data(filestem: &Path, expected_events: &[Event]) {
86+
fn process_profiling_data(filestem: &Path, expected_events: &[Event<'static>]) {
8787
let profiling_data = ProfilingData::new(filestem).unwrap();
8888

8989
let mut count = 0;

0 commit comments

Comments
 (0)