{"record":{"id":"040104b1c00fcbb6","repo":"sxyazi/yazi","slug":"package-url-cannot-be-empty","errorCode":null,"errorMessage":"Package URL cannot be empty","messagePattern":"Package URL cannot be empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"yazi-cli/src/package/dependency.rs","lineNumber":101,"sourceCode":"\t\tfiles.sort_unstable();\n\t\tOk(files)\n\t}\n\n\tpub(super) fn flavor_files() -> Vec<String> {\n\t\t[\"LICENSE\", \"LICENSE-tmtheme\", \"README.md\", \"flavor.toml\", \"preview.png\", \"tmtheme.xml\"]\n\t\t\t.into_iter()\n\t\t\t.map(Into::into)\n\t\t\t.collect()\n\t}\n}\n\nimpl FromStr for Dependency {\n\ttype Err = anyhow::Error;\n\n\tfn from_str(s: &str) -> std::result::Result<Self, Self::Err> {\n\t\tlet mut parts = s.splitn(2, ':');\n\n\t\tlet Some(parent) = parts.next() else { bail!(\"Package URL cannot be empty\") };\n\t\tlet child = parts.next().unwrap_or_default();\n\n\t\tlet Some((_, repo)) = parent.split_once('/') else {\n\t\t\tbail!(\"Package URL `{parent}` must be in the format `owner/repository`\")\n\t\t};\n\n\t\tlet name = if child.is_empty() { repo } else { child };\n\t\tif !name.as_bytes().kebab_cased() {\n\t\t\tbail!(\"Package name `{name}` must be in kebab-case\")\n\t\t}\n\n\t\tOk(Self {\n\t\t\tr#use: s.to_owned(),\n\t\t\tname: format!(\"{name}.yazi\"),\n\t\t\tparent: format!(\"{parent}{}\", if child.is_empty() { \".yazi\" } else { \"\" }),\n\t\t\tchild: if child.is_empty() { String::new() } else { format!(\"{child}.yazi\") },\n\t\t\t..Default::default()\n\t\t})","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/sxyazi/yazi/blob/5f901b886b14de1f17460b6e52e9de5d67f8aba9/yazi-cli/src/package/dependency.rs#L83-L119","documentation":"Dependency-URL parsing guard in `FromStr for Dependency`: the parent segment before the first ':' is empty (e.g. the input is empty or starts with ':'). Note `splitn` always yields at least one part, so this fires exactly when that first part is the empty string.","triggerScenarios":"Thrown at yazi-cli/src/package/dependency.rs:101 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a package URL of the form `owner/repository` or `owner/repository:child`.","Trim whitespace and verify the string is non-empty before parsing."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5f901b886b14de1f17460b6e52e9de5d67f8aba9","analyzedAt":"2026-09-02T18:38:25.566Z","contentChangedAt":"2026-09-02T18:38:25.566Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}