From 03f009d2974286aee49a7f75744f338810171ef3 Mon Sep 17 00:00:00 2001 From: Dragyx <66752602+Dragyx@users.noreply.github.com> Date: Tue, 6 May 2025 16:42:24 +0200 Subject: [PATCH] store: add comments to explain why Path::canonicalize is needed --- src/store.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/store.rs b/src/store.rs index e3557e2..7bc2787 100644 --- a/src/store.rs +++ b/src/store.rs @@ -60,6 +60,7 @@ SELECT p, c from graph; /// /// in the future, we might wan't to switch to async pub fn get_packages(path: &std::path::Path) -> Result> { + // resolve symlinks and convert to a string let p: String = path.canonicalize()?.to_string_lossy().into_owned(); let conn = Connection::open(DATABASE_URL)?; @@ -77,6 +78,7 @@ pub fn get_packages(path: &std::path::Path) -> Result> { /// /// in the future, we might wan't to switch to async pub fn get_closure_size(path: &std::path::Path) -> Result { + // resolve symlinks and convert to a string let p: String = path.canonicalize()?.to_string_lossy().into_owned(); let conn = Connection::open(DATABASE_URL)?; @@ -95,6 +97,7 @@ pub fn get_closure_size(path: &std::path::Path) -> Result { /// /// The mapping from id to graph can be obtained by using [``get_packages``] pub fn get_dependency_graph(path: &std::path::Path) -> Result>> { + // resolve symlinks and convert to a string let p: String = path.canonicalize()?.to_string_lossy().into_owned(); let conn = Connection::open(DATABASE_URL)?;