Skip to content

Commit 6caa163

Browse files
Fix collector compilation
1 parent bd937e5 commit 6caa163

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

collector/src/bin/rustc-perf-collector/main.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use chrono::{Timelike, Utc};
88
use collector::api::collected;
99
use collector::git::get_commit_or_fake_it;
1010
use collector::git::get_rust_commits as get_commits;
11-
use collector::{ArtifactData, Commit, CommitData, Date};
11+
use collector::{ArtifactData, Commit, CommitData, Date, Sha};
1212
use log::{debug, error, info, warn};
1313
use std::collections::BTreeMap;
1414
use std::collections::HashSet;
@@ -200,7 +200,7 @@ fn bench_published(
200200
mut benchmarks: Vec<Benchmark>,
201201
) -> anyhow::Result<()> {
202202
let commit = Commit {
203-
sha: String::from("<none>"),
203+
sha: Sha::from("<none>"),
204204
date: Date::ymd_hms(2010, 01, 01, 0, 0, 0),
205205
};
206206
let cfg = rustup::Cfg::from_env(Arc::new(|_| {})).map_err(|e| anyhow::anyhow!("{:?}", e))?;
@@ -500,7 +500,7 @@ fn main_result() -> anyhow::Result<i32> {
500500
// runs, because `commit` is only used when producing the output
501501
// files, not for interacting with a repo.
502502
let commit = Commit {
503-
sha: id.to_string(),
503+
sha: Sha::from(id),
504504
// Drop the nanoseconds; we don't want that level of precision.
505505
date: Date(Utc::now().with_nanosecond(0).unwrap()),
506506
};

collector/src/bin/rustc-perf-collector/sysroot.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use anyhow::{anyhow, Context};
22
use chrono::{DateTime, TimeZone, Utc};
3+
use collector::Sha;
34
use std::ffi::OsStr;
45
use std::fmt;
56
use std::fs::{self, File};
@@ -23,9 +24,9 @@ pub struct Sysroot {
2324
}
2425

2526
impl Sysroot {
26-
pub fn install(sha: &str, date: DateTime<Utc>, triple: &str) -> anyhow::Result<Self> {
27+
pub fn install(sha: &Sha, date: DateTime<Utc>, triple: &str) -> anyhow::Result<Self> {
2728
let commit = Commit {
28-
sha: sha.to_owned(),
29+
sha: sha.to_string(),
2930
date,
3031
};
3132
let unpack_into = "cache";

0 commit comments

Comments
 (0)