bigint: Stop implementing Debug
for OwnedModulus
.
This was necessary at some point in the past, but no longer is. It is better to avoid depending on any of the `core::fmt` machinery in these lower layers if we can avoid it.
This commit is contained in:
parent
6de27244ff
commit
ca043567e6
@ -791,9 +791,8 @@ prefixed_extern! {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::{modulus::MODULUS_MIN_LIMBS, *};
|
use super::*;
|
||||||
use crate::{limb::LIMB_BYTES, test};
|
use crate::test;
|
||||||
use alloc::format;
|
|
||||||
|
|
||||||
// Type-level representation of an arbitrary modulus.
|
// Type-level representation of an arbitrary modulus.
|
||||||
struct M {}
|
struct M {}
|
||||||
@ -928,16 +927,6 @@ mod tests {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_modulus_debug() {
|
|
||||||
let modulus = OwnedModulus::<M>::from_be_bytes(
|
|
||||||
untrusted::Input::from(&[0xff; LIMB_BYTES * MODULUS_MIN_LIMBS]),
|
|
||||||
cpu::features(),
|
|
||||||
)
|
|
||||||
.unwrap();
|
|
||||||
assert_eq!("Modulus", format!("{:?}", modulus));
|
|
||||||
}
|
|
||||||
|
|
||||||
fn consume_elem<M>(
|
fn consume_elem<M>(
|
||||||
test_case: &mut test::TestCase,
|
test_case: &mut test::TestCase,
|
||||||
name: &str,
|
name: &str,
|
||||||
|
@ -90,14 +90,6 @@ impl<M: PublicModulus> Clone for OwnedModulus<M> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<M: PublicModulus> core::fmt::Debug for OwnedModulus<M> {
|
|
||||||
fn fmt(&self, fmt: &mut ::core::fmt::Formatter) -> Result<(), ::core::fmt::Error> {
|
|
||||||
fmt.debug_struct("Modulus")
|
|
||||||
// TODO: Print modulus value.
|
|
||||||
.finish()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<M> OwnedModulus<M> {
|
impl<M> OwnedModulus<M> {
|
||||||
pub(crate) fn from_be_bytes(
|
pub(crate) fn from_be_bytes(
|
||||||
input: untrusted::Input,
|
input: untrusted::Input,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user