MCPcopy Create free account
hub / github.com/Work-Fisher/code-claw / first_text_block

Function first_text_block

claw-code/rust/crates/runtime/src/compact.rs:281–288  ·  view source on GitHub ↗
(message: &ConversationMessage)

Source from the content-addressed store, hash-verified

279}
280
281fn first_text_block(message: &ConversationMessage) -> Option<&str> {
282 message.blocks.iter().find_map(|block| match block {
283 ContentBlock::Text { text } if !text.trim().is_empty() => Some(text.as_str()),
284 ContentBlock::ToolUse { .. }
285 | ContentBlock::ToolResult { .. }
286 | ContentBlock::Text { .. } => None,
287 })
288}
289
290fn has_interesting_extension(candidate: &str) -> bool {
291 std::path::Path::new(candidate)

Callers 1

Calls 1

as_strMethod · 0.45

Tested by

no test coverage detected