summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKornel <kornel@geekhood.net>2020-03-08 16:31:48 +0000
committerKornel <kornel@geekhood.net>2020-03-10 00:43:42 +0000
commit34bc2b12e637456c8c5140dfcb4a49d11ac544e5 (patch)
treeb326401b3fcf6299d39d007cfefe48ce3e015f3a
parentc516d4775a9d1db845db69e3917c371f894c1e50 (diff)
Priv
-rw-r--r--deps_index/src/deps_stats.rs10
-rw-r--r--deps_index/src/index.rs4
-rw-r--r--kitchen_sink/src/lib_kitchen_sink.rs4
3 files changed, 9 insertions, 9 deletions
diff --git a/deps_index/src/deps_stats.rs b/deps_index/src/deps_stats.rs
index e8ebfec..e78fcf3 100644
--- a/deps_index/src/deps_stats.rs
+++ b/deps_index/src/deps_stats.rs
@@ -69,13 +69,13 @@ pub struct DepVisitor {
}
impl DepVisitor {
- pub fn new() -> Self {
+ pub(crate) fn new() -> Self {
Self {
node_visited: FxHashSet::with_capacity_and_hasher(120, Default::default()),
}
}
- pub fn visit(&mut self, depset: &ArcDepSet, depinf: DepInf, mut cb: impl FnMut(&mut Self, &DepName, &Dep)) {
+ pub(crate) fn visit(&mut self, depset: &ArcDepSet, depinf: DepInf, mut cb: impl FnMut(&mut Self, &DepName, &Dep)) {
let target_addr: &Mutex<FxHashMap<DepName, Dep>> = &*depset;
if self.node_visited.insert((depinf, target_addr as *const _)) {
if let Some(depset) = depset.try_lock() {
@@ -87,12 +87,12 @@ impl DepVisitor {
}
#[inline]
- pub fn start(&mut self, dep: &Dep, depinf: DepInf, cb: impl FnMut(&mut DepVisitor, &ArcDepSet, DepInf)) {
+ pub(crate) fn start(&mut self, dep: &Dep, depinf: DepInf, cb: impl FnMut(&mut DepVisitor, &ArcDepSet, DepInf)) {
self.recurse_inner(dep, DepInf { direct: true, ..depinf }, cb)
}
#[inline]
- pub fn recurse(&mut self, dep: &Dep, depinf: DepInf, cb: impl FnMut(&mut DepVisitor, &ArcDepSet, DepInf)) {
+ pub(crate) fn recurse(&mut self, dep: &Dep, depinf: DepInf, cb: impl FnMut(&mut DepVisitor, &ArcDepSet, DepInf)) {
self.recurse_inner(dep, DepInf { direct: false, ..depinf }, cb)
}
@@ -155,7 +155,7 @@ impl Index {
Ok(converted)
}
- pub fn get_deps_stats(&self) -> DepsStats {
+ pub(crate) fn get_deps_stats(&self) -> DepsStats {
let crates = self.crates_io_crates();
let crates: Vec<(Box<str>, FxHashMap<_,_>)> = crates
.par_iter()
diff --git a/deps_index/src/index.rs b/deps_index/src/index.rs
index 940d3fe..99c6637 100644
--- a/deps_index/src/index.rs
+++ b/deps_index/src/index.rs
@@ -215,7 +215,7 @@ impl Index {
.unwrap_or_else(|| krate.latest_version()) // latest_version = most recently published version
}
- pub fn deps_of_crate(&self, krate: &impl ICrate, query: DepQuery) -> Result<Dep, DepsErr> {
+ pub(crate) fn deps_of_crate(&self, krate: &impl ICrate, query: DepQuery) -> Result<Dep, DepsErr> {
let (latest, features) = krate.latest_version_with_features(query.all_optional);
self.deps_of_crate_int(latest, features, query)
}
@@ -240,7 +240,7 @@ impl Index {
})
}
- pub fn deps_of_ver<'a>(&self, ver: &'a impl IVersion, wants: Features) -> Result<ArcDepSet, DepsErr> {
+ pub(crate) fn deps_of_ver<'a>(&self, ver: &'a impl IVersion, wants: Features) -> Result<ArcDepSet, DepsErr> {
let key = (format!("{}-{}", ver.name(), ver.version()).into(), wants);
if let Some(cached) = self.cache.read().get(&key) {
return Ok(cached.clone());
diff --git a/kitchen_sink/src/lib_kitchen_sink.rs b/kitchen_sink/src/lib_kitchen_sink.rs
index 4d27ad6..21b8074 100644
--- a/kitchen_sink/src/lib_kitchen_sink.rs
+++ b/kitchen_sink/src/lib_kitchen_sink.rs
@@ -1165,7 +1165,7 @@ impl KitchenSink {
warnings
}
- pub async fn check_url_is_valid(&self, url: &str) -> bool {
+ async fn check_url_is_valid(&self, url: &str) -> bool {
if let Ok(Some(res)) = self.url_check_cache.get(url) {
return res;
}
@@ -1600,7 +1600,7 @@ impl KitchenSink {
self.crate_db.parent_crate(repo, child.short_name()).await.ok()?
}
- pub async fn cachebust_string_for_repo(&self, crate_repo: &Repo) -> CResult<String> {
+ async fn cachebust_string_for_repo(&self, crate_repo: &Repo) -> CResult<String> {
Ok(self.crate_db.crates_in_repo(crate_repo).await
.context("db crates_in_repo")?
.into_iter()