summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLinus Färnstrand <linus@mullvad.net>2017-06-12 12:19:36 +0200
committerLinus Färnstrand <linus@mullvad.net>2017-06-12 13:33:15 +0200
commit4c49413f102bdb3cb5b72c3b23fcd1cecf82e4d7 (patch)
treebc266fceb934cf411c5f2ba2a2030be15552b086
parent0bf333e2aead924e2a03a92863f25cc350011777 (diff)
downloadmullvadvpn-4c49413f102bdb3cb5b72c3b23fcd1cecf82e4d7.tar.xz
mullvadvpn-4c49413f102bdb3cb5b72c3b23fcd1cecf82e4d7.zip
Change to infallible uuid constructor
-rw-r--r--mullvad_daemon/src/management_interface.rs7
1 files changed, 1 insertions, 6 deletions
diff --git a/mullvad_daemon/src/management_interface.rs b/mullvad_daemon/src/management_interface.rs
index fb3bdbdf54..28972e676d 100644
--- a/mullvad_daemon/src/management_interface.rs
+++ b/mullvad_daemon/src/management_interface.rs
@@ -167,11 +167,6 @@ impl ManagementInterface {
tx: Mutex::new(tx),
}
}
-
- fn create_id() -> SubscriptionId {
- let id = uuid::Uuid::new(uuid::UuidVersion::Random).expect("Unable to generate UUID");
- SubscriptionId::String(id.to_string())
- }
}
impl ManagementInterfaceApi for ManagementInterface {
@@ -251,7 +246,7 @@ impl ManagementInterfaceApi for ManagementInterface {
trace!("new_state_subscribe");
let mut active_subscriptions = self.active_subscriptions.write().unwrap();
loop {
- let id = Self::create_id();
+ let id = SubscriptionId::String(uuid::Uuid::new_v4().to_string());
if let Entry::Vacant(entry) = active_subscriptions.entry(id.clone()) {
if let Ok(sink) = subscriber.assign_id(id.clone()) {
debug!("Accepting new subscription with id {:?}", id);