Skip to content

Commit

Permalink
Add Equatable to device
Browse files Browse the repository at this point in the history
  • Loading branch information
gemcoder21 committed Sep 7, 2023
1 parent c2439ca commit 0730c58
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions api/src/device/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ impl DevicesClient {
return self.get_device(device_id.as_str());
}

pub fn get_device(&mut self, device_id: &str) -> Result<primitives::device::Device, Box<dyn Error>> {
pub fn get_device(&mut self, device_id: &str) -> Result<primitives::Device, Box<dyn Error>> {
let device = self.database.get_device(device_id)?;
Ok(
primitives::device::Device {
primitives::Device {
id: device.device_id,
platform: Platform::from_str(device.platform.as_str()).unwrap(),
token: device.token,
Expand Down
2 changes: 1 addition & 1 deletion primitives/src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use serde::{Serialize, Deserialize};
use crate::platform::Platform;

#[derive(Debug, Clone, Serialize, Deserialize)]
#[typeshare(swift="Codable")]
#[typeshare(swift="Codable, Equatable")]
#[serde(rename_all = "camelCase")]
pub struct Device {
pub id: String,
Expand Down
2 changes: 1 addition & 1 deletion primitives/src/platform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use typeshare::typeshare;
use serde::{Serialize, Deserialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
#[typeshare(swift="Codable")]
#[typeshare(swift="Codable, Equatable")]
#[serde(rename_all = "lowercase")]
pub enum Platform {
IOS,
Expand Down

0 comments on commit 0730c58

Please sign in to comment.