diff mbox series

[2/3] Use git2::Error explicitly in settings.rs

Message ID 20181213024353.19725-2-mpe@ellerman.id.au
State Accepted
Headers show
Series [1/3] Rework main() to return a Result() | expand

Commit Message

Michael Ellerman Dec. 13, 2018, 2:43 a.m. UTC
So that we can use std:error:Error as Error.
---
 src/settings.rs | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Andrew Donnellan Dec. 13, 2018, 2:59 a.m. UTC | #1
On 13/12/18 1:43 pm, Michael Ellerman wrote:
> So that we can use std:error:Error as Error.

Looks good

With missing SOB line fixed:

Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>

> ---
>   src/settings.rs | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/src/settings.rs b/src/settings.rs
> index 241580b36e20..a5513728fbaa 100644
> --- a/src/settings.rs
> +++ b/src/settings.rs
> @@ -18,7 +18,8 @@ use toml;
>   
>   use serde::de::{self, Deserialize, Deserializer, MapAccess, Visitor};
>   
> -use git2::{Error, Repository};
> +use git2;
> +use git2::Repository;
>   
>   use std::collections::BTreeMap;
>   use std::fmt;
> @@ -69,7 +70,7 @@ pub struct Project {
>   }
>   
>   impl Project {
> -    pub fn get_repo(&self) -> Result<Repository, Error> {
> +    pub fn get_repo(&self) -> Result<Repository, git2::Error> {
>           Repository::open(&self.repository)
>       }
>   }
>
diff mbox series

Patch

diff --git a/src/settings.rs b/src/settings.rs
index 241580b36e20..a5513728fbaa 100644
--- a/src/settings.rs
+++ b/src/settings.rs
@@ -18,7 +18,8 @@  use toml;
 
 use serde::de::{self, Deserialize, Deserializer, MapAccess, Visitor};
 
-use git2::{Error, Repository};
+use git2;
+use git2::Repository;
 
 use std::collections::BTreeMap;
 use std::fmt;
@@ -69,7 +70,7 @@  pub struct Project {
 }
 
 impl Project {
-    pub fn get_repo(&self) -> Result<Repository, Error> {
+    pub fn get_repo(&self) -> Result<Repository, git2::Error> {
         Repository::open(&self.repository)
     }
 }