Skip to content

Commit

Permalink
Document crate feature guards
Browse files Browse the repository at this point in the history
  • Loading branch information
robjtede authored and Veykril committed Jun 1, 2024
1 parent aea39b4 commit 2a02189
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ repository = "https://github.com/rust-analyzer/smol_str"
authors = ["Aleksey Kladov <[email protected]>"]
edition = "2018"

[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"]
all-features = true

[dependencies]
serde = { version = "1.0.136", optional = true, default_features = false }
serde = { version = "1.0.136", optional = true, default-features = false }
arbitrary = { version = "1.1.0", optional = true }

[dev-dependencies]
Expand Down
4 changes: 3 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#![no_std]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]

extern crate alloc;

use alloc::{borrow::Cow, boxed::Box, string::String, sync::Arc};
Expand All @@ -21,7 +23,7 @@ use core::{
/// * Longer than 23 bytes, but substrings of `WS` (see below). Such strings consist
/// solely of consecutive newlines, followed by consecutive spaces
/// * If a string does not satisfy the aforementioned conditions, it is heap-allocated
/// * Additionally, a `SmolStr` can be explicitely created from a `&'static str` without allocation
/// * Additionally, a `SmolStr` can be explicitly created from a `&'static str` without allocation
///
/// Unlike `String`, however, `SmolStr` is immutable. The primary use case for
/// `SmolStr` is a good enough default storage for tokens of typical programming
Expand Down

0 comments on commit 2a02189

Please sign in to comment.