Address clippy comments (#325)

This commit is contained in:
Ryan Orendorff
2023-10-17 16:52:09 -06:00
committed by GitHub
parent 5d843565f7
commit 82a7f2b801
7 changed files with 8 additions and 14 deletions

View File

@@ -163,8 +163,6 @@ where
type Output = PolynomialMatrix<R>;
fn sub(self, rhs: &PolynomialMatrix<R>) -> Self::Output {
let rhs = rhs.borrow();
assert_eq!(self.rows, rhs.rows);
assert_eq!(self.cols, rhs.cols);
@@ -188,8 +186,6 @@ where
type Output = Matrix<R>;
fn add(self, rhs: &Matrix<R>) -> Self::Output {
let rhs = rhs.borrow();
assert_eq!(self.rows, rhs.rows);
assert_eq!(self.cols, rhs.cols);
@@ -284,8 +280,6 @@ where
type Output = PolynomialMatrix<R>;
fn div(self, rhs: &Polynomial<R>) -> Self::Output {
let rhs = rhs.borrow();
let data = self
.data
.par_iter()

View File

@@ -513,7 +513,7 @@ where
impl PartialOrd for SortableEdge {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
self.1.partial_cmp(&other.1)
Some(self.cmp(other))
}
}
@@ -521,7 +521,7 @@ where
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
// PartialCmp will always return Some(_) for usize,
// which is the thing we're comparing.
self.partial_cmp(other).unwrap()
self.1.partial_cmp(&other.1).unwrap()
}
}

View File

@@ -42,7 +42,7 @@ pub trait Render {
/**
* A supertrait that concisely contains all the traits needed to serve
* as an operation for [`NodeInfo`](crate::context::NodeInfo).
* as an operation for [`NodeInfo`].
*
* Also provides functions that describe properties of an operation.
*/

View File

@@ -563,7 +563,7 @@ impl<const N: usize, B: ArithmeticBackend<N>> From<i64> for Zq<N, B> {
impl<const N: usize, B: ArithmeticBackend<N>> PartialOrd for Zq<N, B> {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
self.val.partial_cmp(&other.val)
Some(self.cmp(other))
}
}

View File

@@ -354,7 +354,7 @@ where
.edges_directed(id, Direction::Outgoing)
.map(|x| {
if !matches!(x.weight(), EdgeInfo::Unary) {
return Err(GraphQueryError::NotUnaryOperation)?;
Err(GraphQueryError::NotUnaryOperation)?;
}
match prog[x.target()].operation {
@@ -380,7 +380,7 @@ where
impl PartialOrd for SortableEdge {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
self.1.partial_cmp(&other.1)
Some(self.cmp(other))
}
}

View File

@@ -183,7 +183,7 @@ impl Deref for BigInt {
impl PartialOrd for BigInt {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
self.0.partial_cmp(&other.0)
Some(self.cmp(other))
}
}