-
Notifications
You must be signed in to change notification settings - Fork 274
Move common fields from MessageCommon to Message #946
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
Conversation
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @WaffleLapkin (or someone else) soon. |
| impl Message { | ||
| /// Returns the user who sent the message. | ||
| #[must_use] | ||
| pub fn from(&self) -> Option<&User> { |
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.
Could you deprecate from (the function)? If it's just a field access I don't think we need it. Also the same for sender_chat.
(don't forget to update the changelog too)
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.
It's trivial to get rid of all usages of .from() except this one:
| (filter_from, Message::from), |
Do you still want to deprecate it? If so, should I put #[allow(deprecated)] here?
It goes into user-facing rustdoc, so an anonymous or private function is not a good option here, I guess.
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.
I think you should remove it, I don't think filter_from makes much sense..
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.
@tar-xzf sorry, after re-reading this now I changed my mind >_>
filter_from still makes sense, given that it's an Option.
Please add it back. An #[allow(deprecated)] with a // FIXME: change macro so that we can filter things without getters should be fine.
|
@teloxidebot author |
|
ping @tar-xzf, this is still waiting on you |
|
@teloxidebot ready |
|
Oh noooo, I did not notice the comment and @teloxidebot was not working properly at the moment D: |
WaffleLapkin
left a comment
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.
Sorry again for the lond delay and back&forth changes 😓
Hopefully this should be the last thing.
| impl Message { | ||
| /// Returns the user who sent the message. | ||
| #[must_use] | ||
| pub fn from(&self) -> Option<&User> { |
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.
@tar-xzf sorry, after re-reading this now I changed my mind >_>
filter_from still makes sense, given that it's an Option.
Please add it back. An #[allow(deprecated)] with a // FIXME: change macro so that we can filter things without getters should be fine.
|
r? syrtcevvi |
#945