Skip to content
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

Merged
merged 5 commits into from May 7, 2024

Conversation

tdikland
Copy link
Contributor

@tdikland tdikland commented May 6, 2024

Added additional testing + documentation to some of the newer code.

where
S: Service<Request, Response = Response> + Send + 'static,
S::Future: Send + 'static,
T: Authenticator<Recipient = R, Request = Request>,
Copy link
Contributor Author

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.

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> {
Copy link
Collaborator

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 ...

Copy link
Collaborator

@roeap roeap May 6, 2024

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Today I learned! 😃

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be fixed now 🎉

@roeap roeap merged commit 373726c into delta-incubator:main May 7, 2024
8 checks passed
@tdikland tdikland deleted the tests/docs branch May 7, 2024 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants