Skip to content

Commit 9c41f8d

Browse files
committed
fix: serde(skip) in not serde features
1 parent 81629ff commit 9c41f8d

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ jobs:
6666
toolchain: 'stable'
6767
profile: minimal
6868
override: true
69+
- run: cargo build
6970
# Since cargo test will run tests in parallel, and the crate uses cwd in
7071
# legacy importer and captured stdio for testing logger, so we need to
7172
# run tests in sequentially by adding `--test-threads=1`

src/api.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ pub struct Options {
2828
/// More information: [Sass documentation](https://sass-lang.com/documentation/js-api/interfaces/Options#alertColor)
2929
pub alert_color: Option<bool>,
3030
/// More information: [Sass documentation](https://sass-lang.com/documentation/js-api/interfaces/Options#importers)
31-
#[serde(skip)]
31+
#[cfg_attr(feature = "serde", serde(skip))]
3232
pub importers: Vec<SassImporter>,
3333
/// More information: [Sass documentation](https://sass-lang.com/documentation/js-api/interfaces/Options#loadPaths)
3434
pub load_paths: Vec<PathBuf>,
3535
/// More information: [Sass documentation](https://sass-lang.com/documentation/js-api/interfaces/Options#logger)
36-
#[serde(skip)]
36+
#[cfg_attr(feature = "serde", serde(skip))]
3737
pub logger: Option<BoxedLogger>,
3838
/// More information: [Sass documentation](https://sass-lang.com/documentation/js-api/interfaces/Options#quietDeps)
3939
pub quiet_deps: bool,
@@ -193,7 +193,7 @@ pub struct StringOptions {
193193
/// Field for [Options]
194194
pub common: Options,
195195
/// More information: [Sass documentation](https://sass-lang.com/documentation/js-api/interfaces/StringOptionsWithImporter#importer)
196-
#[serde(skip)]
196+
#[cfg_attr(feature = "serde", serde(skip))]
197197
pub input_importer: Option<SassImporter>,
198198
/// More information: [Sass documentation](https://sass-lang.com/documentation/js-api/interfaces/StringOptionsWithoutImporter#syntax)
199199
/// - [Sass documentation](https://sass-lang.com/documentation/js-api/interfaces/StringOptionsWithImporter#syntax)

src/legacy/api.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ pub struct LegacyOptions {
358358
/// More information: [Sass documentation](https://sass-lang.com/documentation/js-api/interfaces/LegacySharedOptions#sourceMapContents)
359359
pub source_map_contents: bool,
360360
/// More information: [Sass documentation](https://sass-lang.com/documentation/js-api/interfaces/LegacySharedOptions#importer)
361-
#[serde(skip)]
361+
#[cfg_attr(feature = "serde", serde(skip))]
362362
pub importers: Option<Vec<BoxedLegacyImporter>>,
363363
/// More information: [Sass documentation](https://sass-lang.com/documentation/js-api/interfaces/LegacySharedOptions#charset)
364364
pub charset: bool,
@@ -367,7 +367,7 @@ pub struct LegacyOptions {
367367
/// More information: [Sass documentation](https://sass-lang.com/documentation/js-api/interfaces/LegacySharedOptions#verbose)
368368
pub verbose: bool,
369369
/// More information: [Sass documentation](https://sass-lang.com/documentation/js-api/interfaces/LegacySharedOptions#logger)
370-
#[serde(skip)]
370+
#[cfg_attr(feature = "serde", serde(skip))]
371371
pub logger: Option<BoxedLogger>,
372372
/// More information: [Sass documentation](https://sass-lang.com/documentation/js-api/interfaces/LegacyFileOptions#file)
373373
pub file: Option<PathBuf>,

0 commit comments

Comments
 (0)