Fix formatting

This commit is contained in:
Andreas Longva 2022-06-13 09:55:16 +02:00
parent 030f155dc3
commit 80e77d2f9f
1 changed files with 5 additions and 13 deletions

View File

@ -1455,12 +1455,10 @@ fn next_dense_coordinate(
/// assert_eq!(expected_str,generated_matrixmarket_str); /// assert_eq!(expected_str,generated_matrixmarket_str);
/// # Ok(()) } /// # Ok(()) }
/// ``` /// ```
pub fn save_to_matrix_market_str<T, S>( pub fn save_to_matrix_market_str<T, S>(sparse_matrix: &S) -> String
sparse_matrix: &S,
) -> String
where where
T: MatrixMarketScalar, T: MatrixMarketScalar,
S: MatrixMarketExport<T> S: MatrixMarketExport<T>,
{ {
let mut bytes = Vec::<u8>::new(); let mut bytes = Vec::<u8>::new();
// This will call impl<A: Allocator> Write for Vec<u8, A> // This will call impl<A: Allocator> Write for Vec<u8, A>
@ -1496,10 +1494,7 @@ where
/// save_to_matrix_market_file(&matrix,"path/to/matrix.mtx")?; /// save_to_matrix_market_file(&matrix,"path/to/matrix.mtx")?;
/// # Ok(()) } /// # Ok(()) }
/// ``` /// ```
pub fn save_to_matrix_market_file<T, S, P>( pub fn save_to_matrix_market_file<T, S, P>(sparse_matrix: &S, path: P) -> Result<(), std::io::Error>
sparse_matrix: &S,
path: P,
) -> Result<(), std::io::Error>
where where
T: MatrixMarketScalar, T: MatrixMarketScalar,
S: MatrixMarketExport<T>, S: MatrixMarketExport<T>,
@ -1519,14 +1514,11 @@ where
/// ///
/// This is the most general save functionality. See [save_to_matrix_market_file] and /// This is the most general save functionality. See [save_to_matrix_market_file] and
/// [save_to_matrix_market_str] for higher-level functionality. /// [save_to_matrix_market_str] for higher-level functionality.
pub fn save_to_matrix_market<T, S, W>( pub fn save_to_matrix_market<T, S, W>(mut w: W, sparse_matrix: &S) -> Result<(), std::io::Error>
mut w: W,
sparse_matrix: &S,
) -> Result<(), std::io::Error>
where where
T: MatrixMarketScalar, T: MatrixMarketScalar,
S: MatrixMarketExport<T>, S: MatrixMarketExport<T>,
W: Write W: Write,
{ {
// write header // write header
writeln!( writeln!(