Skip to content

Commit 2b775a8

Browse files
committed
pr fixes - spelling + metric as the last column everywhere
1 parent 46848af commit 2b775a8

File tree

5 files changed

+21
-18
lines changed

5 files changed

+21
-18
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
/// Target representing an Rust target tripple, for a full list of targets and
1+
/// Target representing an Rust target triple, for a full list of targets and
22
/// their support see;
33
/// https://doc.rust-lang.org/nightly/rustc/platform-support.html
44
///
55
/// Presently we only support x86_64
66
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, serde::Deserialize)]
77
pub enum Target {
88
/// `x86_64-unknown-linux-gnu`
9-
X86_64UnknownLinuxGnu
9+
X86_64UnknownLinuxGnu,
1010
}
1111

12-
impl Default for Target {
12+
impl Default for Target {
1313
fn default() -> Self {
1414
Self::X86_64UnknownLinuxGnu
15-
}
15+
}
1616
}

database/schema.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,9 @@ many times in the `pstat` table.
152152

153153
```
154154
sqlite> select * from pstat_series limit 1;
155-
id crate profile scenario backend metric target
156-
---------- ---------- ---------- ---------- ------- ------------ ------------
157-
1 helloworld check full llvm task-clock:u x86_64-linux-unknown-gnu
155+
id crate profile scenario backend target metric
156+
---------- ---------- ---------- ---------- ------- ------------ ------------
157+
1 helloworld check full llvm x86_64-linux-unknown-gnu task-clock:u
158158
```
159159

160160
### pstat

database/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ impl PartialOrd for Scenario {
340340
}
341341
}
342342

343-
/// Target representing an Rust target tripple, for a full list of targets and
343+
/// Target representing an Rust target triple, for a full list of targets and
344344
/// their support see;
345345
/// https://doc.rust-lang.org/nightly/rustc/platform-support.html
346346
///
@@ -350,7 +350,7 @@ impl PartialOrd for Scenario {
350350
)]
351351
pub enum Target {
352352
/// `x86_64-unknown-linux-gnu`
353-
X86_64UnknownLinuxGnu
353+
X86_64UnknownLinuxGnu,
354354
}
355355

356356
impl Target {
@@ -630,8 +630,8 @@ pub enum DbLabel {
630630
profile: Profile,
631631
scenario: Scenario,
632632
backend: CodegenBackend,
633-
metric: Metric,
634633
target: Target,
634+
metric: Metric,
635635
},
636636
}
637637

@@ -703,7 +703,7 @@ impl Index {
703703
self.pstat_series
704704
.map
705705
.keys()
706-
.map(|(_, _, _, _, metric, _)| metric)
706+
.map(|(_, _, _, _, _, metric)| metric)
707707
.collect::<std::collections::HashSet<_>>()
708708
.into_iter()
709709
.map(|s| s.to_string())

database/src/pool/postgres.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,8 +637,8 @@ where
637637
Profile::from_str(row.get::<_, String>(2).as_str()).unwrap(),
638638
row.get::<_, String>(3).as_str().parse().unwrap(),
639639
CodegenBackend::from_str(row.get::<_, String>(4).as_str()).unwrap(),
640-
Target::from_str(row.get::<_, String>(6).as_str()).unwrap(),
641-
row.get::<_, String>(5).as_str().into(),
640+
Target::from_str(row.get::<_, String>(5).as_str()).unwrap(),
641+
row.get::<_, String>(6).as_str().into(),
642642
),
643643
)
644644
})

database/src/pool/sqlite.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -387,21 +387,22 @@ static MIGRATIONS: &[Migration] = &[
387387
),
388388
// Add target as a unique constraint, defaulting to 'x86_64-unknown-linux-gnu'
389389
Migration::without_foreign_key_constraints(
390-
r#"
390+
r#"
391391
create table pstat_series_with_target(
392392
id integer primary key not null,
393393
crate text not null references benchmark(name) on delete cascade on update cascade,
394394
profile text not null,
395395
scenario text not null,
396396
backend text not null,
397-
metric text not null,
398397
target text not null default 'x86_64-unknown-linux-gnu',
398+
metric text not null,
399399
UNIQUE(crate, profile, scenario, backend, target, metric)
400400
);
401-
insert into pstat_series_with_target select id, crate, profile, scenario, backend, metric, 'x86_64-unknown-linux-gnu' from pstat_series;
401+
insert into pstat_series_with_target select id, crate, profile, scenario, backend, 'x86_64-unknown-linux-gnu', metric from pstat_series;
402402
drop table pstat_series;
403403
alter table pstat_series_with_target rename to pstat_series;
404-
"#),
404+
"#,
405+
),
405406
];
406407

407408
#[async_trait::async_trait]
@@ -517,7 +518,9 @@ impl Connection for SqliteConnection {
517518
.collect();
518519
let pstat_series = self
519520
.raw()
520-
.prepare("select id, crate, profile, scenario, backend, target, metric from pstat_series;")
521+
.prepare(
522+
"select id, crate, profile, scenario, backend, target, metric from pstat_series;",
523+
)
521524
.unwrap()
522525
.query_map(params![], |row| {
523526
Ok((

0 commit comments

Comments
 (0)