aboutsummaryrefslogtreecommitdiffstats
path: root/src/database.rs
diff options
context:
space:
mode:
authorTeddy Wing2021-05-30 01:25:25 +0200
committerTeddy Wing2021-05-30 01:25:25 +0200
commitd95b531c88f64ba6f920ad5b873e7ce61253a482 (patch)
tree769beabc022d76e2429bf6c69b7122c288d59cef /src/database.rs
parent37cbbc279736f10224ec36356eb2b7620b028081 (diff)
downloadreflectub-d95b531c88f64ba6f920ad5b873e7ce61253a482.tar.bz2
database: Implement `From<github::Repo>` for `database::Repo`
Diffstat (limited to 'src/database.rs')
-rw-r--r--src/database.rs12
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 {