binius_field/
macros.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Copyright 2024 Irreducible Inc.

#[macro_export]
macro_rules! impl_packed_field_display {
	($name:ident) => {
		impl std::fmt::Display for $name {
			fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
				write!(f, "{{")?;
				let mut iter = self.iter();
				if let Some(scalar) = iter.next() {
					write!(f, "{}", scalar)?;
				}
				for scalar in iter {
					write!(f, " {}", scalar)?;
				}
				write!(f, "}}")
			}
		}
	};
}