Page MenuHomePhabricator

Implement Display and TryFrom traits for DeviceType
ClosedPublic

Authored by will on Oct 5 2023, 9:39 PM.
Tags
None
Referenced Files
F2903041: D9384.id31756.diff
Sat, Oct 5, 8:13 PM
F2903012: D9384.id31757.diff
Sat, Oct 5, 8:01 PM
Unknown Object (File)
Sat, Sep 7, 5:53 AM
Unknown Object (File)
Aug 29 2024, 4:28 AM
Unknown Object (File)
Aug 28 2024, 8:20 AM
Unknown Object (File)
Aug 28 2024, 5:44 AM
Unknown Object (File)
Aug 28 2024, 4:51 AM
Unknown Object (File)
Aug 26 2024, 6:57 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