Skip to content

Commit

Permalink
fixed + refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
adamnemecek committed Jan 5, 2025
1 parent b6ebe64 commit c97b069
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion nalgebra-sparse/src/io/matrix_market.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ impl fmt::Display for MatrixMarketError {
MatrixMarketErrorKind::NotLowerTriangle => "NotLowerTriangle,",
MatrixMarketErrorKind::NonSquare => "NonSquare,",
};
write!(f, {}, msg)?;
write!(f, "{}", msg)?;
write!(f, " message: {}", self.message)
}
}
Expand Down
8 changes: 4 additions & 4 deletions nalgebra-sparse/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ impl<'a, T: Clone + Zero> SparseEntry<'a, T> {
/// stored.
pub fn into_value(self) -> T {
match self {
SparseEntry::NonZero(value) => value.clone(),
SparseEntry::Zero => T::zero(),
Self::NonZero(value) => value.clone(),
Self::Zero => T::zero(),
}
}
}
Expand All @@ -275,8 +275,8 @@ impl<'a, T: Clone + Zero> SparseEntryMut<'a, T> {
/// stored.
pub fn into_value(self) -> T {
match self {
SparseEntryMut::NonZero(value) => value.clone(),
SparseEntryMut::Zero => T::zero(),
Self::NonZero(value) => value.clone(),
Self::Zero => T::zero(),
}
}
}
8 changes: 4 additions & 4 deletions nalgebra-sparse/src/pattern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,18 +347,18 @@ impl From<SparsityPatternFormatError> for SparseFormatError {
| InvalidOffsetFirstLast
| NonmonotonicOffsets
| NonmonotonicMinorIndices => {
SparseFormatError::from_kind_and_error(InvalidStructure, Box::from(err))
Self::from_kind_and_error(InvalidStructure, Box::from(err))
}
MinorIndexOutOfBounds => {
SparseFormatError::from_kind_and_error(IndexOutOfBounds, Box::from(err))
Self::from_kind_and_error(IndexOutOfBounds, Box::from(err))
}
PatternDuplicateEntry => SparseFormatError::from_kind_and_error(
PatternDuplicateEntry => Self::from_kind_and_error(
#[allow(unused_qualifications)]
SparseFormatErrorKind::DuplicateEntry,
Box::from(err),
),
}
}
}q
}
impl fmt::Display for SparsityPatternFormatError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
Expand Down

0 comments on commit c97b069

Please sign in to comment.