Skip to content

Commit c74f766

Browse files
committed
move struct Commit to root of crate module hierarchy.
1 parent 1ed199d commit c74f766

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/git.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,13 @@ const RUST_SRC_REPO: Option<&str> = option_env!("RUST_SRC_REPO");
1212

1313
use std::path::Path;
1414

15-
use chrono::{DateTime, TimeZone, Utc};
15+
use chrono::{TimeZone, Utc};
1616
use failure::{bail, Error};
1717
use git2::build::RepoBuilder;
1818
use git2::{Commit as Git2Commit, Repository};
1919
use log::debug;
2020

21-
#[derive(Debug, Clone, PartialEq)]
22-
pub struct Commit {
23-
pub sha: String,
24-
pub date: DateTime<Utc>,
25-
pub summary: String,
26-
}
21+
use crate::Commit;
2722

2823
impl Commit {
2924
// Takes &mut because libgit2 internally caches summaries

src/main.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use std::path::{Path, PathBuf};
1515
use std::process::{self, Command, Stdio};
1616
use std::str::FromStr;
1717

18-
use chrono::{Date, Duration, naive, Utc};
18+
use chrono::{Date, DateTime, Duration, naive, Utc};
1919
use dialoguer::Select;
2020
use failure::{bail, format_err, Fail, Error};
2121
use flate2::read::GzDecoder;
@@ -36,6 +36,13 @@ mod least_satisfying;
3636

3737
use crate::least_satisfying::{least_satisfying, Satisfies};
3838

39+
#[derive(Debug, Clone, PartialEq)]
40+
pub struct Commit {
41+
pub sha: String,
42+
pub date: DateTime<Utc>,
43+
pub summary: String,
44+
}
45+
3946
/// The first commit which build artifacts are made available through the CI for
4047
/// bisection.
4148
///
@@ -47,7 +54,7 @@ const EPOCH_COMMIT: &str = "927c55d86b0be44337f37cf5b0a76fb8ba86e06c";
4754
const NIGHTLY_SERVER: &str = "https://static.rust-lang.org/dist";
4855
const CI_SERVER: &str = "https://s3-us-west-1.amazonaws.com/rust-lang-ci2";
4956

50-
fn get_commits(start: &str, end: &str) -> Result<Vec<git::Commit>, Error> {
57+
fn get_commits(start: &str, end: &str) -> Result<Vec<Commit>, Error> {
5158
eprintln!("fetching commits from {} to {}", start, end);
5259
let commits = git::get_commits_between(start, end)?;
5360
assert_eq!(commits.first().expect("at least one commit").sha, git::expand_commit(start)?);

0 commit comments

Comments
 (0)