refactor: Apply cargo recommended refactoring
This commit is contained in:
parent
c0685e9b7b
commit
dd19c90ae1
5 changed files with 7 additions and 15 deletions
|
|
@ -1,19 +1,15 @@
|
|||
use std::usize;
|
||||
|
||||
use anyhow::Result;
|
||||
use base64::{prelude::BASE64_STANDARD, Engine};
|
||||
use serde_json::Value;
|
||||
|
||||
use crate::{
|
||||
tasks,
|
||||
utils::{
|
||||
use crate::utils::{
|
||||
self,
|
||||
dff::ddf,
|
||||
edf::edf,
|
||||
field::FieldElement,
|
||||
poly::{gcd, Polynomial},
|
||||
sff::{sff, Factors},
|
||||
},
|
||||
};
|
||||
|
||||
pub fn gfpoly_add(args: &Value) -> Result<Polynomial> {
|
||||
|
|
@ -126,7 +122,7 @@ pub fn gfpoly_gcd(args: &Value) -> Result<Polynomial> {
|
|||
Ok(result)
|
||||
}
|
||||
|
||||
pub fn gfpoly_factor_sff(arsg: &Value) -> Result<Vec<(Factors)>> {
|
||||
pub fn gfpoly_factor_sff(arsg: &Value) -> Result<Vec<Factors>> {
|
||||
let poly_f = Polynomial::from_c_array(&arsg["F"].clone());
|
||||
|
||||
let mut factors = sff(poly_f);
|
||||
|
|
@ -143,7 +139,7 @@ pub fn gfpoly_factor_sff(arsg: &Value) -> Result<Vec<(Factors)>> {
|
|||
Ok(result)
|
||||
}
|
||||
|
||||
pub fn gfpoly_factor_ddf(arsg: &Value) -> Result<Vec<(utils::dff::Factors)>> {
|
||||
pub fn gfpoly_factor_ddf(arsg: &Value) -> Result<Vec<utils::dff::Factors>> {
|
||||
let poly_f = Polynomial::from_c_array(&arsg["F"].clone());
|
||||
|
||||
let mut factors = ddf(poly_f);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use std::usize;
|
||||
|
||||
use num::{cast::AsPrimitive, pow::Pow, traits::ToBytes, BigUint, FromPrimitive};
|
||||
use num::{pow::Pow, BigUint, FromPrimitive};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use super::poly::{gcd, Polynomial};
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
use base64::{prelude::BASE64_STANDARD, Engine};
|
||||
use num::{BigUint, FromPrimitive, Integer, One};
|
||||
use num::{BigUint, FromPrimitive, One};
|
||||
use rand::Rng;
|
||||
|
||||
use crate::utils::{field::FieldElement, poly::non_monic_gcd};
|
||||
|
||||
use super::poly::{gcd, Polynomial};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
use base64::prelude::*;
|
||||
use rand::{random, Rng, RngCore};
|
||||
use std::{u128, u8, usize};
|
||||
|
||||
use std::{
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
use crate::utils::field::ByteArray;
|
||||
use base64::alphabet::BIN_HEX;
|
||||
use base64::prelude::*;
|
||||
use num::{BigInt, BigUint, One, Zero};
|
||||
use num::{BigUint, One, Zero};
|
||||
use std::{str::FromStr, u128, u8, usize};
|
||||
|
||||
use std::{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue