Skip to content

Commit 0ea9c93

Browse files
committed
delete empty SofosConfig impl block and note that Option::context always returns a config error
1 parent c6d7cc8 commit 0ea9c93

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/config.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,6 @@ impl ModelConfig {
7979
}
8080
}
8181

82-
impl SofosConfig {
83-
// No need for new() since Default::default() is the idiomatic way
84-
}
85-
8682
/// Per-model trim-safety floor. Above this value the conversation
8783
/// trim drops older messages without summary as a last resort —
8884
/// auto-compaction (which preserves context) runs much earlier at

src/error_ext.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ where
3535
}
3636
}
3737

38+
/// Maps every `None` to [`SofosError::Config`]. This is a foot-gun —
39+
/// callers using these methods on a `None` that doesn't represent
40+
/// missing *configuration* (e.g. a runtime handle or a parse result)
41+
/// get the wrong variant, which leaks "config" semantics into
42+
/// [`SofosError::hint`] routing. Preserved for now; the right fix is
43+
/// a deliberate variant choice, not a refactor.
3844
impl<T> ResultExt<T> for Option<T> {
3945
fn context(self, msg: impl Into<String>) -> Result<T> {
4046
self.ok_or_else(|| SofosError::Config(msg.into()))

0 commit comments

Comments
 (0)