diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2020-04-28 19:50:03 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2020-04-28 20:26:27 +0200 |
commit | 7533256d9ab21d455ad5691c2a68940bd30b72d9 (patch) | |
tree | 2beb69d23e49ef16258dce0728fb0bd2d6f6c5c3 | |
parent | 1890f31b514a2d9de59baffe2a812bcd56102a1b (diff) |
It does only need the device name to load the app
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r-- | src/app.rs | 13 |
1 files changed, 4 insertions, 9 deletions
@@ -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<Self, Error> { - 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<Self, Error> { + Repository::new(host, port).map(|repo| App { repo, device_name, publishing_key }) } pub async fn new_profile(repo: Repository, names: Vec<String>) -> Result<Self> { @@ -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 }) } |