Skip to content

Commit 08bd265

Browse files
committed
Use convenience methods more.
1 parent 02c4711 commit 08bd265

File tree

2 files changed

+5
-25
lines changed

2 files changed

+5
-25
lines changed

samply/src/windows/coreclr.rs

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -228,16 +228,8 @@ impl Marker for CoreClrGcAllocMarker {
228228
Some("GC Alloc: {marker.data.clrtype} ({marker.data.size} bytes)");
229229

230230
const FIELDS: &'static [MarkerField] = &[
231-
MarkerField {
232-
key: "clrtype",
233-
label: "CLR Type",
234-
format: MarkerFieldFormat::String,
235-
},
236-
MarkerField {
237-
key: "size",
238-
label: "Size",
239-
format: MarkerFieldFormat::Bytes,
240-
},
231+
MarkerField::string("clrtype", "CLR Type"),
232+
MarkerField::bytes("size", "Size"),
241233
];
242234

243235
fn name(&self, profile: &mut Profile) -> StringHandle {
@@ -274,11 +266,7 @@ impl Marker for CoreClrGcEventMarker {
274266
const TOOLTIP_LABEL: Option<&'static str> = Some("{marker.data.event}");
275267
const TABLE_LABEL: Option<&'static str> = Some("{marker.name} - {marker.data.event}");
276268

277-
const FIELDS: &'static [MarkerField] = &[MarkerField {
278-
key: "event",
279-
label: "Event",
280-
format: MarkerFieldFormat::String,
281-
}];
269+
const FIELDS: &'static [MarkerField] = &[MarkerField::string("event", "Event")];
282270

283271
fn name(&self, _profile: &mut Profile) -> StringHandle {
284272
self.0
@@ -743,11 +731,7 @@ impl Marker for OtherClrMarker {
743731
const TOOLTIP_LABEL: Option<&'static str> = Some("{marker.data.name}");
744732
const TABLE_LABEL: Option<&'static str> = Some("{marker.name} - {marker.data.name}");
745733

746-
const FIELDS: &'static [MarkerField] = &[MarkerField {
747-
key: "name",
748-
label: "Name",
749-
format: MarkerFieldFormat::String,
750-
}];
734+
const FIELDS: &'static [MarkerField] = &[MarkerField::string("name", "Name")];
751735

752736
fn name(&self, _profile: &mut Profile) -> StringHandle {
753737
self.0

samply/src/windows/profile_context.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2204,11 +2204,7 @@ impl Marker for FreeformMarker {
22042204
const TOOLTIP_LABEL: Option<&'static str> = Some("{marker.name} - {marker.data.values}");
22052205
const TABLE_LABEL: Option<&'static str> = Some("{marker.name} - {marker.data.values}");
22062206

2207-
const FIELDS: &'static [MarkerField] = &[MarkerField {
2208-
key: "values",
2209-
label: "Values",
2210-
format: MarkerFieldFormat::String,
2211-
}];
2207+
const FIELDS: &'static [MarkerField] = &[MarkerField::string("values", "Values")];
22122208

22132209
fn name(&self, _profile: &mut Profile) -> StringHandle {
22142210
self.0

0 commit comments

Comments
 (0)