-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added some tests and documentation #54
Conversation
where | ||
S: Service<Request, Response = Response> + Send + 'static, | ||
S::Future: Send + 'static, | ||
T: Authenticator<Recipient = R, Request = Request>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I like to model structs as "just data" and put the bounds on the impls.
delta-sharing/server/src/auth.rs
Outdated
pub struct AnonymousAuthenticator; | ||
|
||
impl Authenticator for AnonymousAuthenticator { | ||
type Request = Request; | ||
type Recipient = DeltaRecipient; | ||
|
||
fn authenticate(&self, _: &Self::Request) -> Result<Self::Recipient, CoreError> { | ||
fn authenticate(&self, _request: &Self::Request) -> Result<Self::Recipient, CoreError> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is a slight nuance here and in practice there likely is no difference, but _request
will create a variable binding that is dropped at the end of the scope, while for _
this binding will never be created ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the former case it just tells the compiler not to complain about an unused variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Today I learned! 😃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fixed now 🎉
Added additional testing + documentation to some of the newer code.