From 3bdead1cf207e3ab9c8fcbfc454c054c726ba6f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Wed, 12 May 2021 15:04:47 +0200 Subject: [PATCH] client-api: Allow the DeviceId to turn into a DeviceIdOrAllDevices --- crates/ruma-client-api/src/r0/to_device.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/ruma-client-api/src/r0/to_device.rs b/crates/ruma-client-api/src/r0/to_device.rs index f25fcee2..537883e4 100644 --- a/crates/ruma-client-api/src/r0/to_device.rs +++ b/crates/ruma-client-api/src/r0/to_device.rs @@ -32,6 +32,12 @@ impl Display for DeviceIdOrAllDevices { } } +impl From for DeviceIdOrAllDevices { + fn from(d: DeviceIdBox) -> Self { + DeviceIdOrAllDevices::DeviceId(d) + } +} + impl TryFrom<&str> for DeviceIdOrAllDevices { type Error = &'static str; fn try_from(device_id_or_all_devices: &str) -> Result {