From 56b0580a9a2438e6aebc236f88686ec41a1e273c Mon Sep 17 00:00:00 2001 From: Robert Garrett Date: Sun, 20 Jul 2025 17:23:44 -0500 Subject: [PATCH] Add docstring for PartialConfig::try_from() I started to replace this with an infallible `try()` implementation before realizing that this exists specifically to filter out the no-such-table result. That isn't an error *in this context*, which is what the try_from() is doing for me. --- src/config.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/config.rs b/src/config.rs index a7b81c9..1a256ea 100644 --- a/src/config.rs +++ b/src/config.rs @@ -161,6 +161,12 @@ impl PartialConfig { impl TryFrom<&Table> for PartialConfig { type Error = crate::config::Error; + /// Scans properties out of a `toml::Table` to get a PartialConfig. + /// + /// `Error::NoSuchProperty` is quietly ignored (mapped to `None`) since it + /// isn't an error in this context. + /// + /// All other errors are propagated and should be treated as real failures. fn try_from(value: &Table) -> Result { Ok(Self { // can't get table name because that key is gone by this point.