mach: Do not use unstable rust for rustfmt (#31441)

We can use stable rust if we pass the unstable configuration as
command-line arguments to rustfmt itself. This prevents needing to
install an unstable rust toolchain.

The one downside here is that it doesn't seem that "ignore" is
supported so we have to start formatting the files in "third_party."
This shouldn't be a huge issue because we don't plan to check much more
rust code into those directories.
This commit is contained in:
Martin Robinson 2024-02-28 14:53:04 +01:00 committed by GitHub
parent 2afd5431b1
commit 98bd306816
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 32 additions and 21 deletions

View file

@ -269,8 +269,10 @@ where
buffer.get()
},
});
let Ok(array) = array as Result<CustomAutoRooterGuard<'_, TypedArray<T, *mut JSObject>>, &mut ()> else{
return Err(())
let Ok(array) =
array as Result<CustomAutoRooterGuard<'_, TypedArray<T, *mut JSObject>>, &mut ()>
else {
return Err(());
};
unsafe {
let slice = (*array).as_slice();
@ -305,9 +307,10 @@ where
buffer.get()
},
});
let Ok(mut array) = array as Result<CustomAutoRooterGuard<'_, TypedArray<T, *mut JSObject>>, &mut ()> else
{
return Err(())
let Ok(mut array) =
array as Result<CustomAutoRooterGuard<'_, TypedArray<T, *mut JSObject>>, &mut ()>
else {
return Err(());
};
unsafe {
let slice = (*array).as_mut_slice();