Skip to content

Commit

Permalink
feat: Add no_std directive
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmah309 committed Sep 11, 2024
1 parent cc1c5c0 commit 922d771
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
9 changes: 5 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "error_set"
description = "An error set macro that simplifies error management by providing a streamlined method for defining errors and easily converting between them. Inspired by Zig's error set type."
categories = ["rust-patterns"]
categories = ["rust-patterns", "no-std"]
keywords = ["error", "error-handling", "macro", "error-set"]
version = "0.5.0"
edition = "2021"
Expand All @@ -26,14 +26,15 @@ members = ["impl"]

[features]
default = []
std = []
# Each error set will generates a `coerce!` macro to help handle coercion between partially intersecting sets.
coerce_macro = ["error_set_impl/coerce_macro"]
# Enables support for the tracing crate. Adds methods to `Result` that are applied on `Err` - e.g. `result.warn(...)`.
tracing = ["dep:tracing"]
tracing = ["std", "dep:tracing"]
# Enables support for the log crate. Adds methods to `Result` that are applied on `Err` - e.g. `result.warn(...)`.
log = ["dep:log"]
log = ["std", "dep:log"]
# Enables support for the log/tracing api, without pulling in either crate. Allowing a downstream to choose the appropriate crate.
record_stub = []
record_stub = ["std"]

[package.metadata.docs.rs]
all-features = false
Expand Down
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![no_std]

#![cfg_attr(not(feature = "std"), no_std)]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![doc = include_str!("../README.md")]

Expand Down

0 comments on commit 922d771

Please sign in to comment.