summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2020-04-28 19:50:03 +0200
committerMatthias Beyer <mail@beyermatthias.de>2020-04-28 20:26:27 +0200
commit7533256d9ab21d455ad5691c2a68940bd30b72d9 (patch)
tree2beb69d23e49ef16258dce0728fb0bd2d6f6c5c3
parent1890f31b514a2d9de59baffe2a812bcd56102a1b (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.rs13
1 files 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<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 })
}