Skip to content

Commit bc2e80a

Browse files
authored
Merge pull request #194 from msfjarvis/hs/2022-02-14/fix-warnings
Fix build warnings from Rust 2018 idioms
2 parents 12593fb + 9ad20d5 commit bc2e80a

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

crox/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ fn generate_thread_to_collapsed_thread_mapping(
120120
thread_to_collapsed_thread
121121
}
122122

123-
fn get_args(full_event: &analyzeme::Event) -> Option<FxHashMap<String, String>> {
123+
fn get_args(full_event: &analyzeme::Event<'_>) -> Option<FxHashMap<String, String>> {
124124
if !full_event.additional_data.is_empty() {
125125
Some(
126126
full_event

measureme/src/event_id.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ impl<'p> EventIdBuilder<'p> {
8383

8484
pub fn from_label_and_args(&self, label: StringId, args: &[StringId]) -> EventId {
8585
// Store up to 7 components on the stack: 1 label + 3 arguments + 3 argument separators
86-
let mut parts = SmallVec::<[StringComponent; 7]>::with_capacity(1 + args.len() * 2);
86+
let mut parts = SmallVec::<[StringComponent<'_>; 7]>::with_capacity(1 + args.len() * 2);
8787

8888
parts.push(StringComponent::Ref(label));
8989

summarize/src/aggregate.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ impl<'a, I: BackwardsIterator<Item = SampleInterval<WithParent<Event<'a>>>>> Bac
322322
match self.sample_intervals_per_profile.get_mut(0)?.next_back() {
323323
Some(interval) => {
324324
let first_duration = interval.duration();
325-
let descriptions = interval.map_event(WithParent::<EventDescription>::from);
325+
let descriptions = interval.map_event(WithParent::<EventDescription<'_>>::from);
326326

327327
// FIXME(eddyb) maybe extract this part into an `Iterator` impl? but it
328328
// would be hard to return an interable that doesn't allocate nor borrow
@@ -344,7 +344,7 @@ impl<'a, I: BackwardsIterator<Item = SampleInterval<WithParent<Event<'a>>>>> Bac
344344
// of each profile are themselves identical.
345345
assert_eq!(
346346
descriptions,
347-
interval.map_event(WithParent::<EventDescription>::from),
347+
interval.map_event(WithParent::<EventDescription<'_>>::from),
348348
"`summarize aggregate` requires identical sequences of events"
349349
);
350350

summarize/src/analysis.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ pub fn perform_analysis(data: ProfilingData) -> Results {
118118

119119
let mut query_data = FxHashMap::<String, QueryData>::default();
120120
let mut artifact_sizes = BTreeMap::<Cow<'_, str>, ArtifactSize>::default();
121-
let mut threads = FxHashMap::<_, PerThreadState>::default();
121+
let mut threads = FxHashMap::<_, PerThreadState<'_>>::default();
122122

123123
let mut record_event_data = |label: &Cow<'_, str>, f: &dyn Fn(&mut QueryData)| {
124124
if let Some(data) = query_data.get_mut(&label[..]) {

summarize/src/signed_duration.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ impl Sub for SignedDuration {
5757
}
5858

5959
impl fmt::Debug for SignedDuration {
60-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
60+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6161
if self.is_positive {
6262
write!(f, "+")?;
6363
} else {

0 commit comments

Comments
 (0)