chore: address clippy lint
This commit is contained in:
parent
7675a2c782
commit
69b3ef7d59
1 changed files with 15 additions and 7 deletions
22
src/page.rs
22
src/page.rs
|
@ -28,14 +28,22 @@ pub struct Page {
|
||||||
|
|
||||||
impl Page {
|
impl Page {
|
||||||
pub fn create_repo(&self) -> Repository {
|
pub fn create_repo(&self) -> Repository {
|
||||||
let repo = Repository::open(&self.path);
|
let repo = match Repository::open(&self.path) {
|
||||||
|
Ok(repo) => repo,
|
||||||
let repo = if repo.is_err() {
|
Err(e) => {
|
||||||
info!("Cloning repository {} at {}", self.repo, self.path);
|
log::error!("Opening repo {} caused error {}", &self.path, e);
|
||||||
Repository::clone(&self.repo, &self.path).unwrap()
|
info!("Cloning repository {} at {}", self.repo, self.path);
|
||||||
} else {
|
Repository::clone(&self.repo, &self.path).unwrap()
|
||||||
repo.unwrap()
|
}
|
||||||
};
|
};
|
||||||
|
//let repo = Repository::open(&self.path);
|
||||||
|
|
||||||
|
//let repo = if repo.is_err() {
|
||||||
|
// info!("Cloning repository {} at {}", self.repo, self.path);
|
||||||
|
// Repository::clone(&self.repo, &self.path).unwrap()
|
||||||
|
//} else {
|
||||||
|
// repo.unwrap()
|
||||||
|
//};
|
||||||
// let branch = repo.find_branch(&self.branch, BranchType::Local).unwrap();
|
// let branch = repo.find_branch(&self.branch, BranchType::Local).unwrap();
|
||||||
|
|
||||||
//repo.branches(BranchType::Local).unwrap().find(|b| b.unwrap().na
|
//repo.branches(BranchType::Local).unwrap().find(|b| b.unwrap().na
|
||||||
|
|
Loading…
Add table
Reference in a new issue