Skip to content

Commit 76a82b0

Browse files
committed
Make some queries pub(crate)
1 parent 79914f6 commit 76a82b0

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

crates/oak_db/src/db.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ pub trait Db: DbInputs {
8383
}
8484

8585
#[salsa::tracked(returns(ref))]
86-
pub fn live_roots_query(db: &dyn Db) -> Vec<LiveRoot> {
86+
pub(crate) fn live_roots_query(db: &dyn Db) -> Vec<LiveRoot> {
8787
let mut roots: Vec<LiveRoot> = db
8888
.workspace_roots()
8989
.roots(db)
@@ -108,7 +108,7 @@ pub fn live_roots_query(db: &dyn Db) -> Vec<LiveRoot> {
108108
/// entity), but every step is: each [`root_url_index`] call returns a
109109
/// cached map, so adding a file to one root invalidates only that
110110
/// root's index.
111-
pub fn file_by_url_query(db: &dyn Db, url: &UrlId) -> Option<File> {
111+
pub(crate) fn file_by_url_query(db: &dyn Db, url: &UrlId) -> Option<File> {
112112
for &root in db.live_roots() {
113113
let hit = match root {
114114
LiveRoot::Workspace(r) | LiveRoot::Library(r) => {
@@ -126,7 +126,7 @@ pub fn file_by_url_query(db: &dyn Db, url: &UrlId) -> Option<File> {
126126
/// Implementation of [`Db::package_by_name`]. Same shape as
127127
/// [`file_by_url_query`]; orphan has no packages, so it contributes
128128
/// nothing to the walk.
129-
pub fn package_by_name_query(db: &dyn Db, name: &str) -> Option<Package> {
129+
pub(crate) fn package_by_name_query(db: &dyn Db, name: &str) -> Option<Package> {
130130
for &root in db.live_roots() {
131131
if let LiveRoot::Workspace(r) | LiveRoot::Library(r) = root {
132132
if let Some(&pkg) = root_package_index(db, r).get(name) {
@@ -139,7 +139,7 @@ pub fn package_by_name_query(db: &dyn Db, name: &str) -> Option<Package> {
139139

140140
/// Implementation of [`Db::root_by_package`]. Walks all live roots looking for
141141
/// `pkg` in their `packages` vec, picking the longest-path root on ties.
142-
pub fn root_by_package_query(db: &dyn Db, pkg: Package) -> Option<Root> {
142+
pub(crate) fn root_by_package_query(db: &dyn Db, pkg: Package) -> Option<Root> {
143143
let mut best: Option<(Root, usize)> = None;
144144
for &root in db.live_roots() {
145145
let (LiveRoot::Workspace(r) | LiveRoot::Library(r)) = root else {

0 commit comments

Comments
 (0)