refactor: replace get_* and set_* methods with direct field access
Co-authored-by: aider (openai/andrew/openrouter/anthropic/claude-sonnet-4) <aider@aider.chat>
This commit is contained in:
@@ -130,31 +130,22 @@ impl MetaPlugin for MagicFileMetaPlugin {
|
||||
}
|
||||
|
||||
fn configure(&mut self, options: &std::collections::HashMap<String, serde_yaml::Value>) -> Result<()> {
|
||||
if let Some(outputs) = options.get("outputs") {
|
||||
if let Some(outputs_map) = outputs.as_mapping() {
|
||||
for (key, value) in outputs_map {
|
||||
if let Some(key_str) = key.as_str() {
|
||||
self.outputs.insert(key_str.to_string(), value.clone());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(max_buffer_size) = options.get("max_buffer_size") {
|
||||
if let Some(size) = max_buffer_size.as_u64() {
|
||||
self.max_buffer_size = size as usize;
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
// Call default implementation for outputs
|
||||
MetaPlugin::configure(self, options)
|
||||
}
|
||||
|
||||
fn get_outputs(&self) -> &std::collections::HashMap<String, serde_yaml::Value> {
|
||||
fn outputs(&self) -> &std::collections::HashMap<String, serde_yaml::Value> {
|
||||
&self.outputs
|
||||
}
|
||||
|
||||
fn set_outputs(&mut self, outputs: std::collections::HashMap<String, serde_yaml::Value>) {
|
||||
self.outputs = outputs;
|
||||
fn outputs_mut(&mut self) -> &mut std::collections::HashMap<String, serde_yaml::Value> {
|
||||
&mut self.outputs
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user