From 9aaa5b8b33546a5abb84397bc2cd798bbb02002f Mon Sep 17 00:00:00 2001 From: Nym Seddon Date: Thu, 21 Jan 2021 21:13:59 +0000 Subject: [PATCH] Add Default implementation for ExtendedGcd Allow users of the ExtendedGcd struct to build a default instance. Allows for custom implementation of the `extended_gcd` function in other crates, without exposing the `_hidden` field. --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 0281954..ef6c8b7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -351,7 +351,7 @@ pub trait Integer: Sized + Num + PartialOrd + Ord + Eq { /// let e = isize::extended_gcd(a, b); /// assert_eq!(e.gcd, e.x*a + e.y*b); /// ``` -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)] pub struct ExtendedGcd { pub gcd: A, pub x: A,