From 2e4cacaaba2b93caa0625de4dfc5ca1ee73bbe3b Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Wed, 27 Aug 2025 21:50:04 -0300 Subject: [PATCH] feat: add derive_more for NumberOrString and ProgramWriter Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) --- src/args.rs | 4 +++- src/meta_plugin/shell.rs | 1 + src/plugins.rs | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/args.rs b/src/args.rs index 339a934..1519b5e 100644 --- a/src/args.rs +++ b/src/args.rs @@ -136,10 +136,12 @@ pub struct OptionsArgs { pub force: bool, } +use derive_more::From; + /** * Enum for representing either a number or a string. */ -#[derive(Debug, Clone)] +#[derive(Debug, Clone, From)] pub enum NumberOrString { Number(i64), Str(String), diff --git a/src/meta_plugin/shell.rs b/src/meta_plugin/shell.rs index 9c67d79..fbd9ac2 100644 --- a/src/meta_plugin/shell.rs +++ b/src/meta_plugin/shell.rs @@ -1,4 +1,5 @@ use std::env; + use crate::meta_plugin::{MetaPlugin, MetaPluginType}; #[derive(Debug, Clone, Default)] diff --git a/src/plugins.rs b/src/plugins.rs index ae934ef..61ab3bb 100644 --- a/src/plugins.rs +++ b/src/plugins.rs @@ -5,12 +5,17 @@ use std::io::Write; +use derive_more::{Deref, DerefMut}; + /// A wrapper around a child process's stdin that implements the Write trait. /// /// This struct allows writing data to an external process's standard input /// in a way that's compatible with Rust's I/O traits. +#[derive(Deref, DerefMut)] pub struct ProgramWriter { /// The stdin handle of a spawned child process + #[deref] + #[deref_mut] pub stdin: std::process::ChildStdin, }