Skip to content

Remove unneeded PhantomData#494

Merged
zaharidichev merged 1 commit intozd/handle-grpc-body-errorsfrom
ver/zd-handle-grpc-no-phantom
Apr 29, 2020
Merged

Remove unneeded PhantomData#494
zaharidichev merged 1 commit intozd/handle-grpc-body-errorsfrom
ver/zd-handle-grpc-no-phantom

Conversation

@olix0r
Copy link
Member

@olix0r olix0r commented Apr 28, 2020

The changes to the Respond trait eliminate the need for our
implementation to track the repsonse-body type via PhantomData.

The changes to the `Respond` trait eliminate the need for our
implementation to track the repsonse-body type via `PhantomData`.
@olix0r olix0r requested a review from zaharidichev April 28, 2020 16:17
#[derive(Debug)]
pub struct NewRespond<B>(std::marker::PhantomData<fn() -> B>);
#[derive(Copy, Clone, Debug)]
pub struct NewRespond(());
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: this is done to prevent instantiation NewRespond directly from outside of this module. not critical but something we do frequently to encourage going through the constructors.

@olix0r olix0r mentioned this pull request Apr 28, 2020
Copy link
Member

@zaharidichev zaharidichev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zaharidichev zaharidichev merged commit ad63a46 into zd/handle-grpc-body-errors Apr 29, 2020
@olix0r olix0r deleted the ver/zd-handle-grpc-no-phantom branch May 26, 2020 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants