Skip to content

Commit 887a543

Browse files
committed
docs: update readme
1 parent b874023 commit 887a543

File tree

2 files changed

+20
-18
lines changed

2 files changed

+20
-18
lines changed

README.md

+10-9
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ use kdl::KdlDocument;
2323
let doc_str = r#"
2424
hello 1 2 3
2525
26-
world prop="value" {
26+
// Comment
27+
world prop=value {
2728
child 1
2829
child 2
30+
child #inf
2931
}
3032
"#;
3133

@@ -112,15 +114,14 @@ KDL itself does not specify a particular representation for numbers and
112114
accepts just about anything valid, no matter how large and how small. This
113115
means a few things:
114116

115-
* Numbers without a decimal point are interpreted as [`u64`].
117+
* Numbers without a decimal point are interpreted as [`i128`].
116118
* Numbers with a decimal point are interpreted as [`f64`].
117-
* Floating point numbers that evaluate to [`f64::INFINITY`] or
118-
[`f64::NEG_INFINITY`] or NaN will be represented as such in the values,
119-
instead of the original numbers.
120-
* A similar restriction applies to overflowed [`u64`] values.
121-
* The original _representation_ of these numbers will be preserved, unless
122-
you [`KdlDocument::fmt`] in which case the original representation will be
123-
thrown away and the actual value will be used when serializing.
119+
* The keywords `#inf`, `#-inf`, and `#nan` evaluate to [`f64::INFINITY`],
120+
[`f64::NEG_INFINITY`], and [`f64::NAN`].
121+
* The original _representation/text_ of these numbers will be preserved,
122+
unless you [`KdlDocument::autoformat`] in which case the original
123+
representation will be thrown away and the actual value will be used when
124+
serializing.
124125

125126
### Minimum Supported Rust Version
126127

src/lib.rs

+10-9
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@
2121
//! let doc_str = r#"
2222
//! hello 1 2 3
2323
//!
24-
//! world prop="value" {
24+
//! // Comment
25+
//! world prop=value {
2526
//! child 1
2627
//! child 2
28+
//! child #inf
2729
//! }
2830
//! "#;
2931
//!
@@ -110,15 +112,14 @@
110112
//! accepts just about anything valid, no matter how large and how small. This
111113
//! means a few things:
112114
//!
113-
//! * Numbers without a decimal point are interpreted as [`u64`].
115+
//! * Numbers without a decimal point are interpreted as [`i128`].
114116
//! * Numbers with a decimal point are interpreted as [`f64`].
115-
//! * Floating point numbers that evaluate to [`f64::INFINITY`] or
116-
//! [`f64::NEG_INFINITY`] or NaN will be represented as such in the values,
117-
//! instead of the original numbers.
118-
//! * A similar restriction applies to overflowed [`u64`] values.
119-
//! * The original _representation_ of these numbers will be preserved, unless
120-
//! you [`KdlDocument::fmt`] in which case the original representation will be
121-
//! thrown away and the actual value will be used when serializing.
117+
//! * The keywords `#inf`, `#-inf`, and `#nan` evaluate to [`f64::INFINITY`],
118+
//! [`f64::NEG_INFINITY`], and [`f64::NAN`].
119+
//! * The original _representation/text_ of these numbers will be preserved,
120+
//! unless you [`KdlDocument::autoformat`] in which case the original
121+
//! representation will be thrown away and the actual value will be used when
122+
//! serializing.
122123
//!
123124
//! ## Minimum Supported Rust Version
124125
//!

0 commit comments

Comments
 (0)