Skip to content

Commit 4c0d43e

Browse files
committed
update return type
1 parent ce50670 commit 4c0d43e

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

check_diff/src/lib.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ pub enum CheckDiffError {
1818
IO(std::io::Error),
1919
}
2020

21+
pub struct GlobalRunners {
22+
pub feature_runner: RustfmtRunner,
23+
pub src_runner: RustfmtRunner,
24+
}
25+
2126
pub struct RustfmtRunner {
2227
pub ld_library_path: String,
2328
pub binary_path: PathBuf,
@@ -258,7 +263,7 @@ pub fn compile_rustfmt(
258263
remote_repo_url: String,
259264
feature_branch: String,
260265
commit_hash: Option<String>,
261-
) -> Result<[RustfmtRunner; 2], CheckDiffError> {
266+
) -> Result<GlobalRunners, CheckDiffError> {
262267
const RUSTFMT_REPO: &str = "https://github.com/rust-lang/rustfmt.git";
263268

264269
clone_git_repo(RUSTFMT_REPO, dest)?;
@@ -291,5 +296,8 @@ pub fn compile_rustfmt(
291296
get_binary_version(&feature_binary, &(feature_runner.ld_library_path))?;
292297
info!("FEATURE_BIN {}\n", feature_binary_version);
293298

294-
return Ok([src_runner, feature_runner]);
299+
return Ok(GlobalRunners {
300+
src_runner,
301+
feature_runner,
302+
});
295303
}

0 commit comments

Comments
 (0)