MCPcopy Create free account
hub / github.com/LeenHawk/sgproxy / extract_inline_query_value

Function extract_inline_query_value

src/oauth.rs:577–590  ·  view source on GitHub ↗
(raw: &str, key: &str)

Source from the content-addressed store, hash-verified

575}
576
577fn extract_inline_query_value(raw: &str, key: &str) -> Option<String> {
578 let needle = format!("{key}=");
579 let index = raw.find(&needle)?;
580 let start = index + needle.len();
581 let rest = &raw[start..];
582 let end = rest
583 .find(['&', '#', '"', '\'', ' ', '\n', '\r', '\t'])
584 .unwrap_or(rest.len());
585 let value = rest[..end].trim();
586 if value.is_empty() {
587 return None;
588 }
589 Some(percent_decode_lossy(value))
590}
591
592fn extract_labeled_value(raw: &str, key: &str) -> Option<String> {
593 for line in raw.lines() {

Callers 1

extract_value_from_textFunction · 0.85

Calls 1

percent_decode_lossyFunction · 0.85

Tested by

no test coverage detected