summaryrefslogtreecommitdiff
path: root/crates/typst-kit/src/package.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2025-03-12 13:46:03 +0100
committerGitHub <noreply@github.com>2025-03-12 12:46:03 +0000
commit95a7e28e25be8374f8574244cc46cf42e97b937e (patch)
tree9e4337419ebe236e135b43667a05986d8c1a1058 /crates/typst-kit/src/package.rs
parent37bb632d2e9f1f779e15dd5c21ff1ceeadea4a17 (diff)
Make two typst-kit functions private (#6045)
Diffstat (limited to 'crates/typst-kit/src/package.rs')
-rw-r--r--crates/typst-kit/src/package.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/crates/typst-kit/src/package.rs b/crates/typst-kit/src/package.rs
index 1a1abd60..584ec83c 100644
--- a/crates/typst-kit/src/package.rs
+++ b/crates/typst-kit/src/package.rs
@@ -78,7 +78,8 @@ impl PackageStorage {
self.package_path.as_deref()
}
- /// Make a package available in the on-disk.
+ /// Makes a package available on-disk and returns the path at which it is
+ /// located (will be either in the cache or package directory).
pub fn prepare_package(
&self,
spec: &PackageSpec,
@@ -111,7 +112,7 @@ impl PackageStorage {
Err(PackageError::NotFound(spec.clone()))
}
- /// Try to determine the latest version of a package.
+ /// Tries to determine the latest version of a package.
pub fn determine_latest_version(
&self,
spec: &VersionlessPackageSpec,
@@ -144,7 +145,7 @@ impl PackageStorage {
}
/// Download the package index. The result of this is cached for efficiency.
- pub fn download_index(&self) -> StrResult<&[serde_json::Value]> {
+ fn download_index(&self) -> StrResult<&[serde_json::Value]> {
self.index
.get_or_try_init(|| {
let url = format!("{DEFAULT_REGISTRY}/{DEFAULT_NAMESPACE}/index.json");
@@ -165,7 +166,7 @@ impl PackageStorage {
///
/// # Panics
/// Panics if the package spec namespace isn't `DEFAULT_NAMESPACE`.
- pub fn download_package(
+ fn download_package(
&self,
spec: &PackageSpec,
cache_dir: &Path,