Page MenuHomePhabricator

[identity] Replace usage of Device enum with DeviceType
ClosedPublic

Authored by will on Oct 12 2023, 3:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 24, 8:25 PM
Unknown Object (File)
Fri, Nov 22, 6:54 PM
Unknown Object (File)
Fri, Nov 22, 6:49 PM
Unknown Object (File)
Thu, Nov 21, 5:48 AM
Unknown Object (File)
Thu, Nov 21, 5:48 AM
Unknown Object (File)
Thu, Nov 21, 5:48 AM
Unknown Object (File)
Thu, Nov 21, 5:48 AM
Unknown Object (File)
Thu, Nov 21, 5:47 AM
Subscribers

Details

Summary

We can replace the usage of Device in database.rs and client_service.rs with the code generated DeviceType enum.
This reduces code duplication as we have implemented Display and TryFrom traits in shared.

Test Plan

Wrote basic unit tests utilizing try_from in database.rs and cargo builds

Diff Detail

Repository
rCOMM Comm
Branch
wyilio/replace_device_enum
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

will requested review of this revision.Oct 12 2023, 3:37 PM
This revision is now accepted and ready to land.Oct 18 2023, 12:06 PM
services/identity/src/database.rs
1564 ↗(On Diff #31978)

let's rename this test something more precise like test_int_to_device_type(). rn it's unclear what we're trying to convert the int to

services/identity/src/database.rs
75 ↗(On Diff #31978)

DBDeviceTypeInt would be more clear imo

will marked an inline comment as done.

Rename DBDeviceInt with DBDeviceTypeInt and test name

This revision was landed with ongoing or failed builds.Oct 18 2023, 1:30 PM
This revision was automatically updated to reflect the committed changes.