From 1585c84d7ba81c6e929d7020db9ca15891d43414 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Garillot?= Date: Sat, 23 Dec 2023 11:12:24 -0500 Subject: [PATCH] refactor: Refactor trait imports in provider/traits.rs - Refactored `provider/traits.rs` to remove local definitions of helper traits. - Incorporated `GroupOps`, `GroupOpsOwned`, and `ScalarMulOwned` from `group` module into `provider/traits.rs` to maintain functionality. --- src/provider/traits.rs | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/src/provider/traits.rs b/src/provider/traits.rs index 22ba4696c..0ed61f420 100644 --- a/src/provider/traits.rs +++ b/src/provider/traits.rs @@ -1,8 +1,6 @@ use crate::traits::{commitment::ScalarMul, Group, TranscriptReprTrait}; -use core::{ - fmt::Debug, - ops::{Add, AddAssign, Sub, SubAssign}, -}; +use core::fmt::Debug; +use group::{GroupOps, GroupOpsOwned, ScalarMulOwned}; use serde::{Deserialize, Serialize}; /// Represents a compressed version of a group element @@ -25,25 +23,6 @@ pub trait CompressedGroup: fn decompress(&self) -> Option; } -/// A helper trait for types with a group operation. -pub trait GroupOps: - Add + Sub + AddAssign + SubAssign -{ -} - -impl GroupOps for T where - T: Add + Sub + AddAssign + SubAssign -{ -} - -/// A helper trait for references with a group operation. -pub trait GroupOpsOwned: for<'r> GroupOps<&'r Rhs, Output> {} -impl GroupOpsOwned for T where T: for<'r> GroupOps<&'r Rhs, Output> {} - -/// A helper trait for references implementing group scalar multiplication. -pub trait ScalarMulOwned: for<'r> ScalarMul<&'r Rhs, Output> {} -impl ScalarMulOwned for T where T: for<'r> ScalarMul<&'r Rhs, Output> {} - /// A trait that defines extensions to the Group trait pub trait DlogGroup: Group