wip 2
This commit is contained in:
@@ -89,3 +89,23 @@ starlark::starlark_simple_value!(Source);
|
||||
|
||||
#[starlark_value(type = "source")]
|
||||
impl<'v> StarlarkValue<'v> for Source {}
|
||||
|
||||
impl Source {
|
||||
pub fn url(&self) -> &str {
|
||||
match self {
|
||||
Self::Tarball(source) => source.url(),
|
||||
Self::Git(source) => source.url(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn cache_key(&self) -> &str {
|
||||
match self {
|
||||
Self::Tarball(source) => source.sha256(),
|
||||
Self::Git(source) => source.commit(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_unknown_cache_key(&self) -> bool {
|
||||
matches!(self.cache_key(), "?" | "???")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user