From 25fd976ed572aa611799db9e5f652e649792d25a Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Fri, 22 Nov 2024 19:21:51 +0000 Subject: [PATCH] fix(example): don't use relative path - not allowed --- examples/get.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/get.rs b/examples/get.rs index 4a6ed57..2e39427 100644 --- a/examples/get.rs +++ b/examples/get.rs @@ -20,7 +20,8 @@ async fn main() -> kxio::Result<()> { // Create a `FileSystem` object for accessing files within the current directory. // The object created will return a `PathTraveral` error result if there is an attempt to\ // access a file outside of this directory. - let fs: kxio::fs::FileSystem = kxio::fs::new("./"); + let current_dir = std::env::current_dir().map_err(kxio::fs::Error::Io)?; + let fs: kxio::fs::FileSystem = kxio::fs::new(current_dir); // The URL we will fetch - the readme for this library. let url = "https://git.kemitix.net/kemitix/kxio/raw/branch/main/README.md";