Skip to content

Commit 8392a34

Browse files
committed
Rename Package::load() to load_from_folder()
1 parent c626b96 commit 8392a34

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

crates/ark/src/lsp/inputs/package.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub struct Package {
2424

2525
impl Package {
2626
/// Load a package from a given path.
27-
pub fn load(package_path: &std::path::Path) -> anyhow::Result<Option<Self>> {
27+
pub fn load_from_folder(package_path: &std::path::Path) -> anyhow::Result<Option<Self>> {
2828
let description_path = package_path.join("DESCRIPTION");
2929
let namespace_path = package_path.join("NAMESPACE");
3030

@@ -65,7 +65,7 @@ impl Package {
6565

6666
// For library packages, ensure the invariant that the package name
6767
// matches the folder name
68-
if let Some(pkg) = Self::load(&package_path)? {
68+
if let Some(pkg) = Self::load_from_folder(&package_path)? {
6969
if pkg.description.name != name {
7070
return Err(anyhow::anyhow!(
7171
"`Package` field in `DESCRIPTION` doesn't match folder name '{name}'"

crates/ark/src/lsp/state_handlers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ pub(crate) fn initialize(
8787
// root if found. This means we're dealing with a package
8888
// source.
8989
if state.root.is_none() {
90-
match Package::load(&path) {
90+
match Package::load_from_folder(&path) {
9191
Ok(Some(pkg)) => {
9292
log::info!(
9393
"Root: Loaded package `{pkg}` from {path} as project root",

0 commit comments

Comments
 (0)