mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 11:07:42 +00:00
Added some spacing in const closure
This commit is contained in:
parent
53049f7dcd
commit
6267c60f6a
@ -17,6 +17,7 @@ pub(crate) struct ConstFnOnceClosure<CapturedData, Function> {
|
|||||||
data: CapturedData,
|
data: CapturedData,
|
||||||
func: Function,
|
func: Function,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<CapturedData, Function> ConstFnOnceClosure<CapturedData, Function> {
|
impl<CapturedData, Function> ConstFnOnceClosure<CapturedData, Function> {
|
||||||
/// Function for creating a new closure.
|
/// Function for creating a new closure.
|
||||||
///
|
///
|
||||||
@ -36,6 +37,7 @@ impl<CapturedData, Function> ConstFnOnceClosure<CapturedData, Function> {
|
|||||||
Self { data, func }
|
Self { data, func }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<CapturedData, ClosureArguments, Function> const FnOnce<ClosureArguments>
|
impl<CapturedData, ClosureArguments, Function> const FnOnce<ClosureArguments>
|
||||||
for ConstFnOnceClosure<CapturedData, Function>
|
for ConstFnOnceClosure<CapturedData, Function>
|
||||||
where
|
where
|
||||||
@ -48,6 +50,7 @@ where
|
|||||||
(self.func)(self.data, args)
|
(self.func)(self.data, args)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Struct representing a closure with mutably borrowed data.
|
/// Struct representing a closure with mutably borrowed data.
|
||||||
///
|
///
|
||||||
/// Example:
|
/// Example:
|
||||||
@ -68,6 +71,7 @@ pub(crate) struct ConstFnMutClosure<'a, CapturedData: ?Sized, Function> {
|
|||||||
data: &'a mut CapturedData,
|
data: &'a mut CapturedData,
|
||||||
func: Function,
|
func: Function,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, CapturedData: ?Sized, Function> ConstFnMutClosure<'a, CapturedData, Function> {
|
impl<'a, CapturedData: ?Sized, Function> ConstFnMutClosure<'a, CapturedData, Function> {
|
||||||
/// Function for creating a new closure.
|
/// Function for creating a new closure.
|
||||||
///
|
///
|
||||||
@ -85,6 +89,7 @@ impl<'a, CapturedData: ?Sized, Function> ConstFnMutClosure<'a, CapturedData, Fun
|
|||||||
Self { data, func }
|
Self { data, func }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, CapturedData: ?Sized, ClosureArguments, Function, ClosureReturnValue> const
|
impl<'a, CapturedData: ?Sized, ClosureArguments, Function, ClosureReturnValue> const
|
||||||
FnOnce<ClosureArguments> for ConstFnMutClosure<'a, CapturedData, Function>
|
FnOnce<ClosureArguments> for ConstFnMutClosure<'a, CapturedData, Function>
|
||||||
where
|
where
|
||||||
@ -97,6 +102,7 @@ where
|
|||||||
self.call_mut(args)
|
self.call_mut(args)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, CapturedData: ?Sized, ClosureArguments, Function, ClosureReturnValue> const
|
impl<'a, CapturedData: ?Sized, ClosureArguments, Function, ClosureReturnValue> const
|
||||||
FnMut<ClosureArguments> for ConstFnMutClosure<'a, CapturedData, Function>
|
FnMut<ClosureArguments> for ConstFnMutClosure<'a, CapturedData, Function>
|
||||||
where
|
where
|
||||||
@ -126,6 +132,7 @@ pub(crate) struct ConstFnClosure<'a, CapturedData: ?Sized, Function> {
|
|||||||
data: &'a CapturedData,
|
data: &'a CapturedData,
|
||||||
func: Function,
|
func: Function,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, CapturedData: ?Sized, Function> ConstFnClosure<'a, CapturedData, Function> {
|
impl<'a, CapturedData: ?Sized, Function> ConstFnClosure<'a, CapturedData, Function> {
|
||||||
/// Function for creating a new closure.
|
/// Function for creating a new closure.
|
||||||
///
|
///
|
||||||
@ -144,6 +151,7 @@ impl<'a, CapturedData: ?Sized, Function> ConstFnClosure<'a, CapturedData, Functi
|
|||||||
Self { data, func }
|
Self { data, func }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, CapturedData: ?Sized, Function, ClosureArguments, ClosureReturnValue> const
|
impl<'a, CapturedData: ?Sized, Function, ClosureArguments, ClosureReturnValue> const
|
||||||
FnOnce<ClosureArguments> for ConstFnClosure<'a, CapturedData, Function>
|
FnOnce<ClosureArguments> for ConstFnClosure<'a, CapturedData, Function>
|
||||||
where
|
where
|
||||||
@ -155,6 +163,7 @@ where
|
|||||||
self.call_mut(args)
|
self.call_mut(args)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, CapturedData: ?Sized, Function, ClosureArguments, ClosureReturnValue> const
|
impl<'a, CapturedData: ?Sized, Function, ClosureArguments, ClosureReturnValue> const
|
||||||
FnMut<ClosureArguments> for ConstFnClosure<'a, CapturedData, Function>
|
FnMut<ClosureArguments> for ConstFnClosure<'a, CapturedData, Function>
|
||||||
where
|
where
|
||||||
@ -164,6 +173,7 @@ where
|
|||||||
self.call(args)
|
self.call(args)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<
|
impl<
|
||||||
'a,
|
'a,
|
||||||
CapturedData: ?Sized,
|
CapturedData: ?Sized,
|
||||||
|
Loading…
Reference in New Issue
Block a user