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

Function parse_share_slug

crates/opencode-cli/src/main.rs:3951–3960  ·  view source on GitHub ↗
(url: &str)

Source from the content-addressed store, hash-verified

3949}
3950
3951fn parse_share_slug(url: &str) -> Option<String> {
3952 let trimmed = url.trim_end_matches('/');
3953 if let Some(idx) = trimmed.rfind("/share/") {
3954 return Some(trimmed[idx + 7..].to_string());
3955 }
3956 if let Some(idx) = trimmed.rfind("/s/") {
3957 return Some(trimmed[idx + 3..].to_string());
3958 }
3959 None
3960}
3961
3962async fn import_session_data(file_or_url: String) -> anyhow::Result<()> {
3963 let raw = if file_or_url.starts_with("http://") || file_or_url.starts_with("https://") {

Callers 1

import_session_dataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected