-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Swap return value order in pipes::oneshot #4496
Comments
I'd like to try my hand at this, as my first contribution. |
@nickdesaulniers Great! |
So I'm not too sure about this test: I've modified the order in the function declaration, and am still working through the resulting regressions, but I feel like this is a relic that should get fixed with this bug. EDIT: where can I find the init function of the oneshot module to modify it? |
The init function is generated by the pipes protocol compiler, specifically the I would consider these two separate issues ( For what it's worth I use two basic strategies for working around self-hosting problems:
There's some outdated information about the bootstrapping process here: https://github.com/mozilla/rust/wiki/Note-compiler-snapshots |
Should I make that a separate issue and post line numbers containing all incorrect references? I have them all from |
Yes, that would be great. Thanks. |
tests are green. Pull request inbound |
Swap return value order in pipes::oneshot Issue #4496
Fixed! |
…flip1995 Handle mapping to Option in `map_flatten` lint Fixes rust-lang#4496 The existing [`map_flatten`](https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten) lint suggests changing `expr.map(...).flatten()` to `expr.flat_map(...)` when `expr` is `Iterator`. This PR changes suggestion to `filter_map` instead of `flat_map` when mapping to `Option`, because it is more natural Also here are some questions: * If expression has type which implements `Iterator` trait (`match_trait_method(cx, expr, &paths::ITERATOR) == true`), how can I get type of iterator elements? Currently I use return type of closure inside `map`, but probably it is not good way * I would like to change suggestion range to cover only `.map(...).flatten()`, that is from: ``` let _: Vec<_> = vec![5_i8; 6].into_iter().map(|x| 0..x).flatten().collect(); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `flat_map` instead: `vec![5_i8; 6].into_iter().flat_map ``` to ``` let _: Vec<_> = vec![5_i8; 6].into_iter().map(|x| 0..x).flatten().collect(); ^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `flat_map` instead: `.flat_map(|x| 0..x)` ``` Is it ok? * Is `map_flatten` lint intentionally in `pedantic` category, or could it be moved to `complexity`? changelog: Handle mapping to Option in [`map_flatten`](https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten) lint
oneshot
returns(ChanOne, PortOne)
whilestream
returns(Port, Chan)
. I prefer the port to be first.The text was updated successfully, but these errors were encountered: