优化代码格式,调整断言和格式化共享日历事件输出

This commit is contained in:
xiaoxixi 2026-06-17 22:40:43 +08:00
parent fe2bc3dfd3
commit 2558d6dae1
2 changed files with 10 additions and 3 deletions

View File

@ -874,8 +874,12 @@ mod tests {
&registry, &registry,
); );
assert!(matches!(blocks.first(), Some(ContentBlock::Text { text }) if text == "先看这段文字")); assert!(
assert!(matches!(blocks.get(1), Some(ContentBlock::Text { text }) if text.contains("用户发来了一个文件"))); matches!(blocks.first(), Some(ContentBlock::Text { text }) if text == "先看这段文字")
);
assert!(
matches!(blocks.get(1), Some(ContentBlock::Text { text }) if text.contains("用户发来了一个文件"))
);
} }
} }

View File

@ -1125,7 +1125,10 @@ impl FeishuChannel {
.get("event_key") .get("event_key")
.and_then(|v| v.as_str()) .and_then(|v| v.as_str())
.unwrap_or("unknown"); .unwrap_or("unknown");
(format!("[shared calendar event: {}]", event_key), Vec::new()) (
format!("[shared calendar event: {}]", event_key),
Vec::new(),
)
} else { } else {
("[shared calendar event]".to_string(), Vec::new()) ("[shared calendar event]".to_string(), Vec::new())
} }