Skip to content

Commit

Permalink
fix: remove useless #[must_use] attributes on trait impl
Browse files Browse the repository at this point in the history
  • Loading branch information
samueltardieu committed Mar 2, 2025
1 parent c0296f0 commit e5c8bfd
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 10 deletions.
3 changes: 0 additions & 3 deletions src/directed/edmonds_karp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,6 @@ impl<C: Copy + Zero + Signed + Eq + Ord + Bounded> EdmondsKarp<C> for SparseCapa
}
}

#[must_use]
fn from_matrix(source: usize, sink: usize, capacities: Matrix<C>) -> Self {
assert!(
capacities.is_square(),
Expand Down Expand Up @@ -483,7 +482,6 @@ pub struct DenseCapacity<C> {
unsafe impl<C: Send> Send for DenseCapacity<C> {}

impl<C: Copy + Zero + Signed + Ord + Bounded> EdmondsKarp<C> for DenseCapacity<C> {
#[must_use]
fn new(size: usize, source: usize, sink: usize) -> Self {
assert!(source < size, "source is greater or equal than size");
assert!(sink < size, "sink is greater or equal than size");
Expand All @@ -500,7 +498,6 @@ impl<C: Copy + Zero + Signed + Ord + Bounded> EdmondsKarp<C> for DenseCapacity<C
}
}

#[must_use]
fn from_matrix(source: usize, sink: usize, capacities: Matrix<C>) -> Self {
assert!(
capacities.is_square(),
Expand Down
2 changes: 0 additions & 2 deletions src/grid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,6 @@ impl IntoIterator for Grid {
type Item = (usize, usize);
type IntoIter = GridIntoIterator;

#[must_use]
fn into_iter(self) -> Self::IntoIter {
GridIntoIterator {
grid: self,
Expand Down Expand Up @@ -644,7 +643,6 @@ impl<'a> IntoIterator for &'a Grid {
type Item = (usize, usize);
type IntoIter = GridIterator<'a>;

#[must_use]
fn into_iter(self) -> Self::IntoIter {
GridIterator {
grid: self,
Expand Down
5 changes: 0 additions & 5 deletions src/matrix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ impl<C: Copy> Matrix<C> {
impl<C: Clone + Signed> Neg for Matrix<C> {
type Output = Self;

#[must_use]
fn neg(self) -> Self {
Self {
rows: self.rows,
Expand Down Expand Up @@ -781,7 +780,6 @@ impl<C> Matrix<C> {
impl<C> Index<(usize, usize)> for Matrix<C> {
type Output = C;

#[must_use]
fn index(&self, index: (usize, usize)) -> &C {
&self.data[self.idx(index)]
}
Expand All @@ -790,7 +788,6 @@ impl<C> Index<(usize, usize)> for Matrix<C> {
impl<C> Index<&(usize, usize)> for Matrix<C> {
type Output = C;

#[must_use]
fn index(&self, index: &(usize, usize)) -> &C {
&self[*index]
}
Expand All @@ -812,7 +809,6 @@ impl<C> IndexMut<&(usize, usize)> for Matrix<C> {
impl<C> Deref for Matrix<C> {
type Target = [C];

#[must_use]
fn deref(&self) -> &[C] {
&self.data
}
Expand Down Expand Up @@ -928,7 +924,6 @@ impl<'a, C> IntoIterator for &'a Matrix<C> {
type IntoIter = RowIterator<'a, C>;
type Item = &'a [C];

#[must_use]
fn into_iter(self) -> RowIterator<'a, C> {
RowIterator {
matrix: self,
Expand Down

0 comments on commit e5c8bfd

Please sign in to comment.