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.
This commit is contained in:
2025-07-20 17:23:44 -05:00
parent 46d8618e74
commit 56b0580a9a

View File

@@ -161,6 +161,12 @@ impl PartialConfig {
impl TryFrom<&Table> for PartialConfig { impl TryFrom<&Table> for PartialConfig {
type Error = crate::config::Error; 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<Self> { fn try_from(value: &Table) -> Result<Self> {
Ok(Self { Ok(Self {
// can't get table name because that key is gone by this point. // can't get table name because that key is gone by this point.