-
Notifications
You must be signed in to change notification settings - Fork 909
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
[unstable option] fn_single_line #3358
Comments
Can this option be a little more selective please? E.g., in my opinion, this is fine: @@ -43,8 +97,6 @@
}
impl<T> AsMut<[T]> for Array64<T> {
- fn as_mut(&mut self) -> &mut [T] {
- &mut self.0
- }
+ fn as_mut(&mut self) -> &mut [T] { &mut self.0 }
}
impl<T> Clone for Array64<T>
where T: Copy + Default but this is not: @@ -64,13 +67,9 @@ fn game_host_open<R: Rng>(car: u32, choice: u32, rng: &mut R) -> u32 {
// Returns the door we switch to, given our current choice and
// the open door. There will only be one valid door.
-fn switch_door(choice: u32, open: u32) -> u32 {
- free_doors(&[choice, open])[0]
-}
+fn switch_door(choice: u32, open: u32) -> u32 { free_doors(&[choice, open])[0] }
-fn free_doors(blocked: &[u32]) -> Vec<u32> {
- (0..3).filter(|x| !blocked.contains(x)).collect()
-}
+fn free_doors(blocked: &[u32]) -> Vec<u32> { (0..3).filter(|x| !blocked.contains(x)).collect() }
fn main() {
// The estimation will be more accurate with more simulations The |
How about this : fn free_doors(blocked: &[u32]) -> Vec<u32>
{ (0..3).filter(|x| !blocked.contains(x)).collect() } when Almost type on a line and value on next line ... And I do think this is better : fn free_doors(blocked: &[u32]) -> Vec<u32>
{
(0..3)
.filter(|x| !blocked.contains(x))
.collect()
} even if there is a |
Tracking issue for unstable option: fn_single_line
The text was updated successfully, but these errors were encountered: