From 2278b46a887e715102b060a08bde4854b3a8e66a Mon Sep 17 00:00:00 2001 From: Hubert Date: Sun, 18 Jul 2021 14:01:04 +0200 Subject: [PATCH] compile --- src/error.rs | 4 ++-- src/main.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/error.rs b/src/error.rs index 9beb7f3..5de788c 100644 --- a/src/error.rs +++ b/src/error.rs @@ -10,7 +10,7 @@ impl From for Error { } impl From for actix_web::error::Error { - fn from(_: Error) -> Self { - HttpResponseBuilder::new(StatusCode::BAD_GATEWAY).body("").into() + fn from(e: Error) -> Self { + HttpResponseBuilder::new(StatusCode::BAD_GATEWAY).body(e.0).into() } } \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 494a59e..231edc5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -163,11 +163,11 @@ async fn git_main( let owner = Owner { name : ownername}; let repo = Repository {name : reponame, owner}; let user = User { name : "Hubert".to_string()}; - let gitrepo = GitRepo::new(format!("{}/{}/{}.git", &gitust.repo_root_path, &repo.owner.name, &repo.name).as_str())?; - let path : Vec<(String, String)> = rootname.split("/").map_accum("/git/".to_string() + &ownername + "/" + &reponame + "/" + &commitname, |str_ref, b| { + let path = rootname.split("/").map_accum("/git/".to_string() + &repo.owner.name + "/" + &repo.name + "/" + commit.value(), |str_ref, b| { let href = b + "/" + str_ref; ((str_ref.to_string(), href.clone()), href) }).collect(); + let gitrepo = GitRepo::new(format!("{}/{}/{}.git", &gitust.repo_root_path, &repo.owner.name, &repo.name).as_str())?; // let repogit = match git2::Repository::open(format!("{}/{}/{}.git", &gitust.repo_root_path, &repo.owner.name, &repo.name)) { // Ok(repo) => repo, // Err(e) => panic!("failed to open: {}", e),