Page MenuHomePhabricator

Implement Display and TryFrom traits for DeviceType
ClosedPublic

Authored by will on Oct 5 2023, 9:39 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jul 3, 1:33 PM
Unknown Object (File)
Tue, Jul 2, 7:57 PM
Unknown Object (File)
Tue, Jul 2, 6:03 PM
Unknown Object (File)
Tue, Jul 2, 8:41 AM
Unknown Object (File)
Tue, Jul 2, 3:32 AM
Unknown Object (File)
Mon, Jul 1, 2:31 AM
Unknown Object (File)
Sun, Jun 30, 9:17 PM
Unknown Object (File)
Sat, Jun 29, 11:58 PM
Subscribers

Details

Summary

Implemented Display and TryFrom impls to generated DeviceType object in grpc_clients/identity/src/device.rs.
Being able to marshal the protobuf into a "more realized" object will likely be useful in the future for both devices and services.

Test Plan

Write unit tests located in grpc_clients/identity/src/device.rs for both Display and TryFrom.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

will requested review of this revision.Oct 5 2023, 9:57 PM
varun requested changes to this revision.Oct 6 2023, 11:19 AM

can you elaborate a little on your test plan?

shared/grpc_clients/src/error.rs
6–15 ↗(On Diff #31729)

thanks for filling in the placeholder. can you please do something similar for the other variants?

shared/grpc_clients/src/identity/device.rs
1–4 ↗(On Diff #31729)

nit: can we use crate:: instead of super::? i prefer crate:: because if we reorganize files later it's one less thing to think about

and then group the imports like this:

  • Standard library imports
  • External crate imports
  • Workspace crate imports

this is just a best practice thing

This revision now requires changes to proceed.Oct 6 2023, 11:19 AM

Replace placeholder error message formats for grpc_clients

Convert access of DeviceType from super to crate::identity

Export DeviceType in grpc_clients/identity for usage outside of the crate

Display and TryFrom unit tests for DeviceType

This revision is now accepted and ready to land.Oct 9 2023, 3:27 PM