From 9b87fa4ffa7909b0a72d0e6e1bde6772568def0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20L=C3=B6schner?= Date: Thu, 9 Dec 2021 18:29:45 +0100 Subject: [PATCH] Add cfg attribute to Cow imports --- nalgebra-sparse/src/coo.rs | 3 ++- nalgebra-sparse/src/csc.rs | 3 ++- nalgebra-sparse/src/csr.rs | 3 ++- nalgebra-sparse/src/pattern.rs | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/nalgebra-sparse/src/coo.rs b/nalgebra-sparse/src/coo.rs index d3612bdc..0cebb725 100644 --- a/nalgebra-sparse/src/coo.rs +++ b/nalgebra-sparse/src/coo.rs @@ -1,10 +1,11 @@ //! An implementation of the COO sparse matrix format. use crate::SparseFormatError; -use std::borrow::Cow; #[cfg(feature = "serde-serialize")] use serde::{de, Deserialize, Deserializer, Serialize, Serializer}; +#[cfg(feature = "serde-serialize")] +use std::borrow::Cow; /// A COO representation of a sparse matrix. /// diff --git a/nalgebra-sparse/src/csc.rs b/nalgebra-sparse/src/csc.rs index 28af852d..bd70d4c8 100644 --- a/nalgebra-sparse/src/csc.rs +++ b/nalgebra-sparse/src/csc.rs @@ -7,12 +7,13 @@ use crate::cs::{CsLane, CsLaneIter, CsLaneIterMut, CsLaneMut, CsMatrix}; use crate::csr::CsrMatrix; use crate::pattern::{SparsityPattern, SparsityPatternFormatError, SparsityPatternIter}; use crate::{SparseEntry, SparseEntryMut, SparseFormatError, SparseFormatErrorKind}; -use std::borrow::Cow; use nalgebra::Scalar; use num_traits::One; #[cfg(feature = "serde-serialize")] use serde::{de, Deserialize, Deserializer, Serialize, Serializer}; +#[cfg(feature = "serde-serialize")] +use std::borrow::Cow; use std::slice::{Iter, IterMut}; /// A CSC representation of a sparse matrix. diff --git a/nalgebra-sparse/src/csr.rs b/nalgebra-sparse/src/csr.rs index 43fb2118..bd43927d 100644 --- a/nalgebra-sparse/src/csr.rs +++ b/nalgebra-sparse/src/csr.rs @@ -6,12 +6,13 @@ use crate::cs::{CsLane, CsLaneIter, CsLaneIterMut, CsLaneMut, CsMatrix}; use crate::csc::CscMatrix; use crate::pattern::{SparsityPattern, SparsityPatternFormatError, SparsityPatternIter}; use crate::{SparseEntry, SparseEntryMut, SparseFormatError, SparseFormatErrorKind}; -use std::borrow::Cow; use nalgebra::Scalar; use num_traits::One; #[cfg(feature = "serde-serialize")] use serde::{de, Deserialize, Deserializer, Serialize, Serializer}; +#[cfg(feature = "serde-serialize")] +use std::borrow::Cow; use std::iter::FromIterator; use std::slice::{Iter, IterMut}; diff --git a/nalgebra-sparse/src/pattern.rs b/nalgebra-sparse/src/pattern.rs index 5f01ea10..a833250c 100644 --- a/nalgebra-sparse/src/pattern.rs +++ b/nalgebra-sparse/src/pattern.rs @@ -1,12 +1,13 @@ //! Sparsity patterns for CSR and CSC matrices. use crate::cs::transpose_cs; use crate::SparseFormatError; -use std::borrow::Cow; use std::error::Error; use std::fmt; #[cfg(feature = "serde-serialize")] use serde::{de, Deserialize, Deserializer, Serialize, Serializer}; +#[cfg(feature = "serde-serialize")] +use std::borrow::Cow; /// A representation of the sparsity pattern of a CSR or CSC matrix. ///