-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Remove FromRequest::Config
#2233
Conversation
FromRequest::Config
which should not be exposed as typeFromRequest::Config
Aside from |
This is a breaking change for nothing. |
What was the point in the first place if this associated type isn't actually needed (as #2221 says)?
IMHO "respects some server config" should just be plain documentation (as it already is). |
I like this change, it simplifies the public API. |
Arguing it's needed or not is pointless. You should do that when the trait is first introduced. The point of having it is people don't have to make break change. It's a long standing trait and it works fine and that's all. |
Yeah, it's obvious that the type is not needed. I guess the decision is just whether or not it's worth a breaking change. You could argue both ways. |
IMHO it doesn't mean that things may never be improved. Having breaking changes is OK, that's why we have semver in the first place. I personally like this change. |
What improvement? Reduce one loc when you importing the trait? Does it really make a difference? You have to remember any lib using this trait would be affected and they need a new release just for this change alone. Look at the current betas. You already have enough people can not figuring out how to make actix-xxx be compat with their beta releases. |
Having this coupled with a SemVer major release makes this the right time to make this change. It's vestigial and confusing to consumers. After the change is made, the API will be cleaner and the better for it. |
I'd say that it's not about writing/removing one line of code, but rather figuring out what the heck is it and do you actually need it (spoiler: you don't). The point of upgrades is not only to care about users who already use the library but also to care about ones who will use it in the future. Giving the fact that Rust's popularity constantly grows and Otherwise, we can get stuck forever with "it works for current users, they already know how it works and there is no need to introduce the inconvenience". |
There are so many dead code in current code base and you are like nah they are fine and I want this public API change for nothing to happen. You save one loc for using this trait at the cost of breaking a public API. I won't make further reply in this thread as there is no point to argue for nothing. This PR does nothing break something and real changes for meaningful PRs are ignored. We should put effort on those. |
It also doesn't sound good to me, to be honest. I think it's a good idea to remove all the dead code, because why keep it. |
Yes, the change is trivial, and it is a break change. But, it make the public API cleaner and simple and it does make sense. Now we are marching toward a new, groundbreaking version. It's time to make some break change! |
I'm not entirely convinced about this yet. If it is going to be merged I'd like to see adequate docs for String and Bytes extractors regarding their config type. |
👍 on this. Also, it will be really nice to extend |
I am not a native English speaker. Any one can help to improve the words? |
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 general, I'm happy with the added docs. Great job.
Co-authored-by: Jonas Platte <jplatte@users.noreply.github.com>
Co-authored-by: Jonas Platte <jplatte@users.noreply.github.com>
Co-authored-by: Jonas Platte <jplatte@users.noreply.github.com>
Co-authored-by: Jonas Platte <jplatte@users.noreply.github.com>
Co-authored-by: Jonas Platte <jplatte@users.noreply.github.com>
Co-authored-by: Igor Aleksanov <popzxc@yandex.ru>
2c from a long-time If you have a chance to simplify without losing expressiveness or performance, I'd take it (of course providing good docs on how to move forward). |
I really hope it can be merged before 4.0.0. And what's the problem for the moment? |
OK, this breaks serde_qs: https://github.com/samscott89/serde_qs/blob/main/src/actix.rs#L100 |
@omid There is no workaround required. |
@jplatte thanks. So in this code here: https://github.com/samscott89/serde_qs/blob/main/src/actix.rs#L151 |
I don't really understand what you mean or what the |
PR Type
Refactor
PR Checklist
Overview
closes #2221