From 7533256d9ab21d455ad5691c2a68940bd30b72d9 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Tue, 28 Apr 2020 19:50:03 +0200 Subject: It does only need the device name to load the app Signed-off-by: Matthias Beyer --- src/app.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/app.rs b/src/app.rs index 8477378..158b423 100644 --- a/src/app.rs +++ b/src/app.rs @@ -5,14 +5,14 @@ use crate::types::util::IPNSHash; pub struct App { repo: Repository, - profile: Profile, + device_name: String, publishing_key: String } impl App { - pub fn load(profile: Profile, publishing_key: String, host: &str, port: u16) -> Result { - Repository::new(host, port).map(|repo| App { repo, profile, publishing_key }) + pub fn load(device_name: String, publishing_key: String, host: &str, port: u16) -> Result { + Repository::new(host, port).map(|repo| App { repo, device_name, publishing_key }) } pub async fn new_profile(repo: Repository, names: Vec) -> Result { @@ -27,12 +27,7 @@ impl App { let head = repository.put_content(content).await?; let device_name = repository.publish(&publishing_key, &head).await?; - let profile = Profile { - device_name, - devices: vec![], - }; - - Ok(App { repository, profile, publishing_key }) + Ok(App { repository, device_name, publishing_key }) } -- cgit v1.2.3