aboutsummaryrefslogtreecommitdiffstats
path: root/src/database.rs
diff options
context:
space:
mode:
authorTeddy Wing2021-05-30 15:02:37 +0200
committerTeddy Wing2021-05-30 15:02:37 +0200
commit80a1cda7f857dbb2e776253225446351228072fb (patch)
tree2c56b8cd5ad14c13327bd4027df007078c763341 /src/database.rs
parentbb57eb9167740b8b14b87aafae3898a2517d0909 (diff)
downloadreflectub-80a1cda7f857dbb2e776253225446351228072fb.tar.bz2
main: Mirror new repositories
If we haven't encountered a repository yet, mirror it to the filesystem. Change `From<github::Repo>` to `From<&github::Repo>` so we don't consume the repo and can use it later in the repo list loop.
Diffstat (limited to 'src/database.rs')
-rw-r--r--src/database.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/database.rs b/src/database.rs
index 2a53f0b..c07eca0 100644
--- a/src/database.rs
+++ b/src/database.rs
@@ -11,12 +11,12 @@ pub struct Repo {
updated_at: Option<String>,
}
-impl From<github::Repo> for Repo {
- fn from(repo: github::Repo) -> Self {
+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),
+ name: Some(repo.name.clone()),
+ updated_at: Some(repo.updated_at.clone()),
}
}
}