From 6763ffe45566ddbde4e21aeb327abe2e6198ea6b Mon Sep 17 00:00:00 2001 From: Son Date: Fri, 4 Jan 2019 17:01:32 +1100 Subject: [PATCH] Do a rustfmt for function.rs --- src/libcore/ops/function.rs | 56 +++++++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 21 deletions(-) diff --git a/src/libcore/ops/function.rs b/src/libcore/ops/function.rs index ec2e53412a0a5..444bf09713168 100644 --- a/src/libcore/ops/function.rs +++ b/src/libcore/ops/function.rs @@ -57,13 +57,16 @@ #[stable(feature = "rust1", since = "1.0.0")] #[rustc_paren_sugar] #[rustc_on_unimplemented( - on(Args="()", note="wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}"), - message="expected a `{Fn}<{Args}>` closure, found `{Self}`", - label="expected an `Fn<{Args}>` closure, found `{Self}`", + on( + Args = "()", + note = "wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}" + ), + message = "expected a `{Fn}<{Args}>` closure, found `{Self}`", + label = "expected an `Fn<{Args}>` closure, found `{Self}`" )] #[fundamental] // so that regex can rely that `&str: !FnMut` #[must_use] -pub trait Fn : FnMut { +pub trait Fn: FnMut { /// Performs the call operation. #[unstable(feature = "fn_traits", issue = "29625")] extern "rust-call" fn call(&self, args: Args) -> Self::Output; @@ -136,13 +139,16 @@ pub trait Fn : FnMut { #[stable(feature = "rust1", since = "1.0.0")] #[rustc_paren_sugar] #[rustc_on_unimplemented( - on(Args="()", note="wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}"), - message="expected a `{FnMut}<{Args}>` closure, found `{Self}`", - label="expected an `FnMut<{Args}>` closure, found `{Self}`", + on( + Args = "()", + note = "wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}" + ), + message = "expected a `{FnMut}<{Args}>` closure, found `{Self}`", + label = "expected an `FnMut<{Args}>` closure, found `{Self}`" )] #[fundamental] // so that regex can rely that `&str: !FnMut` #[must_use] -pub trait FnMut : FnOnce { +pub trait FnMut: FnOnce { /// Performs the call operation. #[unstable(feature = "fn_traits", issue = "29625")] extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output; @@ -215,9 +221,12 @@ pub trait FnMut : FnOnce { #[stable(feature = "rust1", since = "1.0.0")] #[rustc_paren_sugar] #[rustc_on_unimplemented( - on(Args="()", note="wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}"), - message="expected a `{FnOnce}<{Args}>` closure, found `{Self}`", - label="expected an `FnOnce<{Args}>` closure, found `{Self}`", + on( + Args = "()", + note = "wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}" + ), + message = "expected a `{FnOnce}<{Args}>` closure, found `{Self}`", + label = "expected an `FnOnce<{Args}>` closure, found `{Self}`" )] #[fundamental] // so that regex can rely that `&str: !FnMut` #[must_use] @@ -233,8 +242,9 @@ pub trait FnOnce { mod impls { #[stable(feature = "rust1", since = "1.0.0")] - impl Fn for &F - where F : Fn + impl Fn for &F + where + F: Fn, { extern "rust-call" fn call(&self, args: A) -> F::Output { (**self).call(args) @@ -242,8 +252,9 @@ mod impls { } #[stable(feature = "rust1", since = "1.0.0")] - impl FnMut for &F - where F : Fn + impl FnMut for &F + where + F: Fn, { extern "rust-call" fn call_mut(&mut self, args: A) -> F::Output { (**self).call(args) @@ -251,8 +262,9 @@ mod impls { } #[stable(feature = "rust1", since = "1.0.0")] - impl FnOnce for &F - where F : Fn + impl FnOnce for &F + where + F: Fn, { type Output = F::Output; @@ -262,8 +274,9 @@ mod impls { } #[stable(feature = "rust1", since = "1.0.0")] - impl FnMut for &mut F - where F : FnMut + impl FnMut for &mut F + where + F: FnMut, { extern "rust-call" fn call_mut(&mut self, args: A) -> F::Output { (*self).call_mut(args) @@ -271,8 +284,9 @@ mod impls { } #[stable(feature = "rust1", since = "1.0.0")] - impl FnOnce for &mut F - where F : FnMut + impl FnOnce for &mut F + where + F: FnMut, { type Output = F::Output; extern "rust-call" fn call_once(self, args: A) -> F::Output {