fix: handle serde_yaml::Value to_string conversion properly
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
@@ -190,11 +190,21 @@ fn build_config_table(settings: &config::Settings) -> Table {
|
|||||||
} else {
|
} else {
|
||||||
let mut output_pairs = Vec::new();
|
let mut output_pairs = Vec::new();
|
||||||
for (key, value) in actual_plugin.outputs() {
|
for (key, value) in actual_plugin.outputs() {
|
||||||
// Convert serde_yaml::Value to string for comparison
|
// Convert serde_yaml::Value to a string representation
|
||||||
let value_str = match value {
|
let value_str = match value {
|
||||||
serde_yaml::Value::String(s) => s.clone(),
|
serde_yaml::Value::String(s) => s.clone(),
|
||||||
_ => value.to_string(),
|
serde_yaml::Value::Number(n) => n.to_string(),
|
||||||
|
serde_yaml::Value::Bool(b) => b.to_string(),
|
||||||
|
serde_yaml::Value::Null => "null".to_string(),
|
||||||
|
serde_yaml::Value::Sequence(_) => {
|
||||||
|
serde_yaml::to_string(value).unwrap_or_else(|_| "[]".to_string())
|
||||||
|
}
|
||||||
|
serde_yaml::Value::Mapping(_) => {
|
||||||
|
serde_yaml::to_string(value).unwrap_or_else(|_| "{}".to_string())
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
// Trim any extra whitespace from the serialized values
|
||||||
|
let value_str = value_str.trim().to_string();
|
||||||
if key == &value_str {
|
if key == &value_str {
|
||||||
output_pairs.push(key.clone());
|
output_pairs.push(key.clone());
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user