MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / filename_from_url

Method filename_from_url

crates/opencode-session/src/prompt.rs:653–663  ·  view source on GitHub ↗
(url: &str)

Source from the content-addressed store, hash-verified

651 }
652
653 fn filename_from_url(url: &str) -> String {
654 if let Ok(parsed) = url::Url::parse(url) {
655 if let Some(last) = parsed
656 .path_segments()
657 .and_then(|segments| segments.filter(|segment| !segment.is_empty()).next_back())
658 {
659 return last.to_string();
660 }
661 }
662 String::new()
663 }
664
665 fn is_text_mime(mime: &str) -> bool {
666 mime.starts_with("text/")

Callers

nothing calls this directly

Calls 3

newFunction · 0.85
is_emptyMethod · 0.80
filterMethod · 0.45

Tested by

no test coverage detected