Skip to content

Commit 24228fe

Browse files
committed
Auto merge of #29020 - goyox86:goyox86/rustfmting-libarena, r=nrc
Hi Rustaceans! This is the result of running latest rustfmt on libarena! //cc @nrc
2 parents 05cfd72 + e7be2c3 commit 24228fe

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/libarena/lib.rs

+9-3
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,9 @@ impl<'longer_than_self> Arena<'longer_than_self> {
245245
}
246246

247247
#[inline]
248-
fn alloc_copy<T, F>(&self, op: F) -> &mut T where F: FnOnce() -> T {
248+
fn alloc_copy<T, F>(&self, op: F) -> &mut T
249+
where F: FnOnce() -> T
250+
{
249251
unsafe {
250252
let ptr = self.alloc_copy_inner(mem::size_of::<T>(), mem::align_of::<T>());
251253
let ptr = ptr as *mut T;
@@ -296,7 +298,9 @@ impl<'longer_than_self> Arena<'longer_than_self> {
296298
}
297299

298300
#[inline]
299-
fn alloc_noncopy<T, F>(&self, op: F) -> &mut T where F: FnOnce() -> T {
301+
fn alloc_noncopy<T, F>(&self, op: F) -> &mut T
302+
where F: FnOnce() -> T
303+
{
300304
unsafe {
301305
let tydesc = get_tydesc::<T>();
302306
let (ty_ptr, ptr) = self.alloc_noncopy_inner(mem::size_of::<T>(), mem::align_of::<T>());
@@ -318,7 +322,9 @@ impl<'longer_than_self> Arena<'longer_than_self> {
318322
/// Allocates a new item in the arena, using `op` to initialize the value,
319323
/// and returns a reference to it.
320324
#[inline]
321-
pub fn alloc<T:'longer_than_self, F>(&self, op: F) -> &mut T where F: FnOnce() -> T {
325+
pub fn alloc<T: 'longer_than_self, F>(&self, op: F) -> &mut T
326+
where F: FnOnce() -> T
327+
{
322328
unsafe {
323329
if intrinsics::needs_drop::<T>() {
324330
self.alloc_noncopy(op)

0 commit comments

Comments
 (0)