-
Notifications
You must be signed in to change notification settings - Fork 84
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
Implement Deref to C for Authorization<C> #100
Conversation
Found by clippy.
Found by clippy.
Found by clippy.
Allow calling `.token()` on `Authorization<Basic>` and `Authorization<Bearer>` without destructuring first.
Ping @seanmonstar |
Hm, usually |
I think its fine since |
I think it's common enough for types that aren't really smart pointers to implement |
Hey @seanmonstar, how can I move this forward? Would you like to first see some more general discussion about types implementing |
That'd be fine to link. So far, I'm still not sure this is a case where using Deref is the right pattern. |
Seems like it's pretty clear that the "only smart pointers" rule is wrong, with there being three examples (two stable) of types contradicting it in
(from rust-lang/api-guidelines#249) |
@seanmonstar if you're still not (fully) convinced, how about I update this PR to provide |
That option seems fine. |
Actually just today I wrote some code where I created my own Did you look at the issue I linked? |
I had to undo automatic formatting a few times, I would recommend you run
cargo fmt
with a recent toolchain so this doesn't happen to other contributors.