Skip to content

Commit 6a87d87

Browse files
committed
app config: rename all method for working with profiles
1 parent 8d9392a commit 6a87d87

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

crates/companion-app/src/config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,13 @@ impl Config {
104104
pub fn get_profile(&self, id: Uuid) -> Option<&Profile> {
105105
self.config.profiles.iter().find(|p| p.id == id)
106106
}
107-
pub fn add_register(&mut self, id: Uuid, name: &str) {
107+
pub fn add_profile(&mut self, id: Uuid, name: &str) {
108108
self.config.profiles.push(Profile {
109109
id,
110110
name: name.to_string(),
111111
});
112112
}
113-
pub fn remove_register(&mut self, id: Uuid) {
113+
pub fn remove_profile(&mut self, id: Uuid) {
114114
self.config.profiles.retain(|p| p.id != id);
115115
}
116116
pub fn save_on_disk(&self) -> Result<(), ConfigError> {

crates/companion-app/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ fn update(state: &mut State, message: Message) -> Task<Message> {
120120
.send(WatchAction::watch(selected_profile))
121121
.unwrap();
122122

123-
config.add_register(resp.id, selected_profile);
123+
config.add_profile(resp.id, selected_profile);
124124
let _ = config
125125
.save_on_disk()
126126
.inspect_err(|e| error!("failed to save config on disk: {e}"));
@@ -186,7 +186,7 @@ fn update(state: &mut State, message: Message) -> Task<Message> {
186186
.send_file_watches
187187
.send(WatchAction::unwatch(&name))
188188
.unwrap();
189-
config.remove_register(id);
189+
config.remove_profile(id);
190190
let _ = config.save_on_disk();
191191
}
192192
}
@@ -241,7 +241,7 @@ fn update(state: &mut State, message: Message) -> Task<Message> {
241241
))
242242
.unwrap();
243243

244-
config.remove_register(id);
244+
config.remove_profile(id);
245245
let _ = config
246246
.save_on_disk()
247247
.inspect_err(|e| error!("failed to save config on disk: {e}"));

0 commit comments

Comments
 (0)