Skip to content

Commit f4dce4b

Browse files
authored
chore: add std feature which provides Error impl
This should provide `Error` implementation for `CursorIconParserError`, when the crate is used with `std`. The `no_std` will require `core::error::Error`, which is not stable yet.
1 parent 4590a92 commit f4dce4b

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,6 @@ jobs:
4343

4444
- name: Run tests
4545
run: cargo test --verbose
46+
47+
- name: Run tests with no default features
48+
run: cargo test --verbose --no-default-features

Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,8 @@ categories = ["gui"]
1212
rust-version = "1.64.0"
1313

1414
[dependencies]
15-
serde = { version = "1.0.162", default-features = false, features = ["derive"], optional = true }
15+
serde = { version = "1.0.162", default-features = false, features = ["derive"], optional = true }
16+
17+
[features]
18+
default = ["std"]
19+
std = []

src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![no_std]
1+
#![cfg_attr(not(feature = "std"), no_std)]
22
#![deny(rust_2018_idioms)]
33
#![deny(rustdoc::broken_intra_doc_links)]
44
#![deny(unsafe_op_in_unsafe_fn)]
@@ -319,3 +319,6 @@ impl core::fmt::Display for CursorIconParseError {
319319
f.write_str("failed to parse cursor icon")
320320
}
321321
}
322+
323+
#[cfg(feature = "std")]
324+
impl std::error::Error for CursorIconParseError {}

0 commit comments

Comments
 (0)