binius_field/macros.rs
1// Copyright 2024-2025 Irreducible Inc.
2
3#[macro_export]
4macro_rules! impl_packed_field_display {
5 ($name:ident) => {
6 impl std::fmt::Display for $name {
7 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8 write!(f, "{{")?;
9 let mut iter = self.iter();
10 if let Some(scalar) = iter.next() {
11 write!(f, "{}", scalar)?;
12 }
13 for scalar in iter {
14 write!(f, " {}", scalar)?;
15 }
16 write!(f, "}}")
17 }
18 }
19 };
20}