Use `config.boolean(…)` instead.
Unified · Split
| @@ -21,6 +21,15 @@ impl TryFrom<OsString> for Boolean { · 20 unmodified lines | |||
| 21 | } | 21 | } |
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | /// # Warning | ||
| 25 | /// | ||
| 26 | /// The direct usage of `try_from("string")` is discouraged as it will produce the wrong result for values | ||
| 27 | /// obtained from `core.bool-implicit-true`, which have no separator and are implicitly true. | ||
| 28 | /// This method chooses to work correctly for `core.bool-empty=`, which is an empty string and resolves | ||
| 29 | /// to being `false`. | ||
| 30 | /// | ||
| 31 | /// Instead of this, obtain booleans with `config.boolean(…)`, which handles the case were no separator is | ||
| 32 | /// present correctly. | ||
| 24 | impl TryFrom<&BStr> for Boolean { | 33 | impl TryFrom<&BStr> for Boolean { |
| 25 | type Error = Error; | 34 | type Error = Error; |
| 26 | 35 | ||