diff options
| author | Teddy Wing | 2021-05-30 01:25:25 +0200 | 
|---|---|---|
| committer | Teddy Wing | 2021-05-30 01:25:25 +0200 | 
| commit | d95b531c88f64ba6f920ad5b873e7ce61253a482 (patch) | |
| tree | 769beabc022d76e2429bf6c69b7122c288d59cef /src | |
| parent | 37cbbc279736f10224ec36356eb2b7620b028081 (diff) | |
| download | reflectub-d95b531c88f64ba6f920ad5b873e7ce61253a482.tar.bz2 | |
database: Implement `From<github::Repo>` for `database::Repo`
Diffstat (limited to 'src')
| -rw-r--r-- | src/database.rs | 12 | 
1 files changed, 11 insertions, 1 deletions
| diff --git a/src/database.rs b/src/database.rs index 83a27b3..954f6b3 100644 --- a/src/database.rs +++ b/src/database.rs @@ -1,6 +1,6 @@  use sqlx::{self, ConnectOptions, Connection, Executor, Row}; -use crate::github::Repo as GithubRepo; +use crate::github;  #[derive(Debug)] @@ -10,6 +10,16 @@ pub struct Repo {      updated_at: Option<String>,  } +impl From<github::Repo> for Repo { +    fn from(repo: github::Repo) -> Self { +        Self { +            id: repo.id, +            name: Some(repo.name), +            updated_at: Some(repo.updated_at), +        } +    } +} +  #[derive(Debug)]  pub struct Db { | 
