fix: resolve compilation errors by standardizing filter signatures and fixing ownership issues

Co-authored-by: aider (openai/andrew/openrouter/sonoma-sky-alpha) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-09-12 12:28:51 -03:00
parent 02d9872b95
commit 82ec29f6a1
10 changed files with 36 additions and 549 deletions

View File

@@ -18,7 +18,7 @@ impl HostnameMetaPlugin {
// Set default outputs
let default_outputs = &["hostname", "hostname_full", "hostname_short"];
base.initialize_plugin(default_outputs, options, outputs);
base.initialize_plugin(default_outputs, &options, &outputs);
// Start with default options - hostname is now boolean only
base.options.insert("hostname".to_string(), serde_yaml::Value::Bool(true));
@@ -26,20 +26,20 @@ impl HostnameMetaPlugin {
base.options.insert("hostname_short".to_string(), serde_yaml::Value::Bool(true));
// Override with provided options
if let Some(opts) = options {
if let Some(opts) = &options {
for (key, value) in opts {
// Convert string "true"/"false" to boolean for hostname option
if key == "hostname"
&& let serde_yaml::Value::String(s) = &value {
&& let serde_yaml::Value::String(s) = value {
if s == "false" {
base.options.insert(key, serde_yaml::Value::Bool(false));
base.options.insert(key.clone(), serde_yaml::Value::Bool(false));
continue;
} else if s == "true" {
base.options.insert(key, serde_yaml::Value::Bool(true));
base.options.insert(key.clone(), serde_yaml::Value::Bool(true));
continue;
}
}
base.options.insert(key, value);
base.options.insert(key.clone(), value.clone());
}
}
@@ -81,21 +81,21 @@ impl HostnameMetaPlugin {
}
// Override with provided outputs, but only if they're enabled
if let Some(outs) = outputs {
if let Some(outs) = &outputs {
for (key, value) in outs {
// Only add if the output is enabled
match key.as_str() {
"hostname" => if hostname_enabled {
final_outputs.insert(key, value);
final_outputs.insert(key.clone(), value.clone());
},
"hostname_full" => if hostname_full_enabled {
final_outputs.insert(key, value);
final_outputs.insert(key.clone(), value.clone());
},
"hostname_short" => if hostname_short_enabled {
final_outputs.insert(key, value);
final_outputs.insert(key.clone(), value.clone());
},
_ => {
final_outputs.insert(key, value);
final_outputs.insert(key.clone(), value.clone());
}
}
}