Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-marinica committed May 20, 2024
1 parent 37c7ee0 commit e993df1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
7 changes: 6 additions & 1 deletion framework/base/src/types/heap/boxed_bytes.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
use alloc::{alloc::{alloc, Layout, realloc}, boxed::Box, vec, vec::Vec};
use alloc::{
alloc::{alloc, realloc, Layout},
boxed::Box,
vec,
vec::Vec,
};

use crate::{
abi::{TypeAbi, TypeAbiFrom, TypeName},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ impl<const N: usize> ManagedVecItemPayloadAdd<ManagedVecItemEmptyPayload>
}

/// Replaces a const generic expression.
///
///
/// Remove once const generic expressions are stabilized in Rust.
macro_rules! payload_add {
($dec1:expr, $dec2:expr, $result_add:expr) => {
Expand Down
8 changes: 2 additions & 6 deletions tools/payload-macro-generator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const MAX_X: usize = 48;
const MAX_Y: usize = 128;

/// Generates the payload_add! macros in the ManagedVecItem implem,entation.
///
///
/// TODO: remove once generic const expressions are stabilized in Rust.
fn main() -> io::Result<()> {
let mut file = File::create("output.rs")?;
Expand All @@ -17,11 +17,7 @@ fn main() -> io::Result<()> {
for x in MIN..=MAX_X {
for y in MIN..=MAX_Y {
let sum = x + y;
writeln!(
file,
"payload_add!({}usize, {}usize, {}usize);",
x, y, sum
)?;
writeln!(file, "payload_add!({}usize, {}usize, {}usize);", x, y, sum)?;
}
}

Expand Down

0 comments on commit e993df1

Please sign in to comment.