[stdlib] Deque - don't use non-self out args#3851
[stdlib] Deque - don't use non-self out args#3851avitkauskas wants to merge 1 commit intomodular:nightlyfrom
Conversation
Signed-off-by: Alvydas Vitkauskas <alvydas.vitkauskas@gmail.com>
|
Pre-commit fails because of reformating of |
Don't worry about this right now. @keith and @walter-erquinigo are looking into it. See #3832. |
|
!sync |
|
✅🟣 This contribution has been merged 🟣✅ Your pull request has been merged to the internal upstream Mojo sources. It will be reflected here in the Mojo repository on the nightly branch during the next Mojo nightly release, typically within the next 24-48 hours. We use Copybara to merge external contributions, click here to learn more. |
|
Landed in 8123754! Thank you for your contribution 🎉 |
[External] [stdlib] Deque - don't use non-self out args As the original author of the Deque, I would like to propose to not use the `out` args instead of `-> ElementType as element` in `pop()` and `popleft()` methods. The named return variable was just a simple convenience in these functions and not needed at all. In general, having something in the args list of the function that you do not pass to the function at the call site looks weird (except for constructors). In my opinion, it makes the function signature just less clear to read and the return type of the function unnecessarily hidden inside the args list. So, let's just use normal return statements here and have a clear function signatures. Co-authored-by: Alvydas Vitkauskas <alvydas.vitkauskas@gmail.com> Closes #3851 MODULAR_ORIG_COMMIT_REV_ID: acae8a18cea7f91639d059e03dff88e3e3d1f5a5
[External] [stdlib] Deque - don't use non-self out args As the original author of the Deque, I would like to propose to not use the `out` args instead of `-> ElementType as element` in `pop()` and `popleft()` methods. The named return variable was just a simple convenience in these functions and not needed at all. In general, having something in the args list of the function that you do not pass to the function at the call site looks weird (except for constructors). In my opinion, it makes the function signature just less clear to read and the return type of the function unnecessarily hidden inside the args list. So, let's just use normal return statements here and have a clear function signatures. Co-authored-by: Alvydas Vitkauskas <alvydas.vitkauskas@gmail.com> Closes #3851 MODULAR_ORIG_COMMIT_REV_ID: acae8a18cea7f91639d059e03dff88e3e3d1f5a5
As the original author of the Deque, I would like to propose to not use the
outargs instead of-> ElementType as elementinpop()andpopleft()methods.The named return variable was just a simple convenience in these functions and not needed at all.
In general, having something in the args list of the function that you do not pass to the function at the call site looks weird (except for constructors). In my opinion, it makes the function signature just less clear to read and the return type of the function unnecessarily hidden inside the args list.
So, let's just use normal return statements here and have a clear function signatures.