Skip to content

Commit

Permalink
docs: Document that toml! macro allows external identifiers and Rus…
Browse files Browse the repository at this point in the history
…t expressions
  • Loading branch information
eduardosm committed Nov 24, 2024
1 parent c72f2e7 commit f6f87f6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions crates/toml/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ use crate::value::{Array, Table, Value};
///
/// println!("{:#?}", cargo_toml);
/// ```
///
/// External identifiers and Rust expressions (between parentheses) are allowed.
///
/// ```rust
/// let some_value = "Hello, world!";
/// let toml_doc = toml::toml! {
/// external_ident = some_value
/// rust_expr = (u16::MAX - 1)
/// };
/// println!("{:#?}", toml_doc);
/// ```
#[macro_export]
macro_rules! toml {
($($toml:tt)+) => {{
Expand Down

0 comments on commit f6f87f6

Please sign in to comment.