-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Remove the std::num::Times trait #11672
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
I liked the |
Let's discuss this further before r+-ing. |
Rebased with some fixes. cc. @bstrie |
Another opeion is to have a for () in 10.times() { ... } |
@flaper87: even without |
I like times and do,, don't remove them! 2014年1月20日 上午7:11于 "Brendan Zabarauskas" notifications@github.com写道:
|
@liigo: |
As @thestinger says, But anyway, the discussion of the fate of |
Rust is not ruby; I don't see why we'd want to have literal syntax über alles. Do is partly gone already and keeping it just for that makes no sense imo, I think it makes sense to cleanup the The do thing: |
FWIW, I meant to say that I liked the old As for the |
@flaper87 |
|
Exactly my point. I know python has support for it. I just don't think we |
Means "range with i elements" to me, doesn't seem that odd. |
+1 |
r=me with a rebase, sounds like we've got enough people on board. |
Ok, I'll try to update this. |
This seems to have already been done since I made this commit. Good work guys! |
Oh huh. I think I made a mistake. Still there. Ok, I will still work on rebasing. Sorry! |
`Times::times` was always a second-class loop because it did not support the `break` and `continue` operations. Its playful appeal was then lost after `do` was disabled for closures. It's time to let this one go.
Ok, rebased! r? |
`Times::times` was always a second-class loop because it did not support the `break` and `continue` operations. Its playful appeal (which I liked) was then lost after `do` was disabled for closures. It's time to let this one go.
Good riddance! :) |
[`unnecessary_lazy_eval`]: reduce applicability if closure has return type annotation Fixes rust-lang#11672 We already check if closure parameters don't have type annotations and reduce the applicability to `MaybeIncorrect` if they do, since those help type inference and removing them breaks code. We didn't do this for return type annotations however. This PR adds it. This doesn't change it to produce a fix that will compile, but it will prevent rustfix from auto-applying it. (In general I'm not sure if we can suggest a fix that will compile. In this specific example, it might be possible to suggest `&[] as &[u8]`, but as-casts won't always work, e.g. `Default::default() as &[u8]` is a compile error, so just reducing applicability should be a safe fix in any case for now) changelog: [`unnecessary_lazy_eval`]: reduce applicability to `MaybeIncorrect` if closure has return type annotation
Times::times
was always a second-class loop because it did not support thebreak
andcontinue
operations. Its playful appeal (which I liked) was then lost afterdo
was disabled for closures. It's time to let this one go.