Skip to content

Commit 6728118

Browse files
committed
fix and check compilation with no features
1 parent 8b809ac commit 6728118

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ jobs:
4242
with:
4343
key: ${{ matrix.TARGET }}
4444

45+
- run: cargo check --target ${{ matrix.TARGET }} --no-default-features
46+
env:
47+
RUSTFLAGS: -D warnings
4548
- run: cargo check --target ${{ matrix.TARGET }}
4649
env:
4750
RUSTFLAGS: -D warnings

src/config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ pub struct Config {
3737
pub base_address_shift: u64,
3838
pub html_url: Option<url::Url>,
3939
/// Path to YAML file with chip-specific settings
40+
#[cfg(feature = "yaml")]
4041
pub settings: Option<PathBuf>,
4142
}
4243

src/generate/device.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,16 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result<Toke
2828
}
2929
};
3030

31+
#[cfg(feature = "yaml")]
3132
let settings = match config.settings.as_ref() {
3233
Some(settings) => {
3334
let file = std::fs::read_to_string(settings).context("could not read settings file")?;
3435
Some(serde_yaml::from_str(&file).context("could not parse settings file")?)
3536
}
3637
None => None,
3738
};
39+
#[cfg(not(feature = "yaml"))]
40+
let settings = None;
3841

3942
if config.target == Target::Msp430 {
4043
out.extend(quote! {

0 commit comments

Comments
 (0)