Clean up fabro-interview extraction

- Use already-imported names in run_from_branch instead of fully-qualified
  fabro_interview::* paths
- Use std::io::Error::other() for serde error conversion (matches codebase
  convention, more concise)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Bryan Helmkamp 2026-03-17 13:56:51 -04:00
parent c18062bc3f
commit 51cfb55128
No known key found for this signature in database
2 changed files with 5 additions and 7 deletions

View file

@ -36,8 +36,7 @@ impl RecordingInterviewer {
/// Returns an error if serialization fails.
pub fn to_json(&self) -> std::io::Result<String> {
let recordings = self.recordings();
serde_json::to_string_pretty(&recordings)
.map_err(|e| std::io::Error::new(std::io::ErrorKind::InvalidData, e))
serde_json::to_string_pretty(&recordings).map_err(std::io::Error::other)
}
/// Deserializes recordings from a JSON string.
@ -45,8 +44,7 @@ impl RecordingInterviewer {
/// # Errors
/// Returns an error if deserialization fails.
pub fn from_json(json: &str) -> std::io::Result<Vec<(Question, Answer)>> {
serde_json::from_str(json)
.map_err(|e| std::io::Error::new(std::io::ErrorKind::InvalidData, e))
serde_json::from_str(json).map_err(std::io::Error::other)
}
/// Saves recordings to a file as JSON.

View file

@ -1706,10 +1706,10 @@ async fn run_from_branch(
};
// Build interviewer
let interviewer: Arc<dyn fabro_interview::Interviewer> = if args.auto_approve {
Arc::new(fabro_interview::AutoApproveInterviewer)
let interviewer: Arc<dyn Interviewer> = if args.auto_approve {
Arc::new(AutoApproveInterviewer)
} else {
Arc::new(fabro_interview::ConsoleInterviewer::new(styles))
Arc::new(ConsoleInterviewer::new(styles))
};
// Build engine with a backend