From 68f633f6ba35a4fbbae9ed22fc759ce3544f6a0e Mon Sep 17 00:00:00 2001 From: Ben Bridle Date: Sun, 11 Aug 2024 12:38:13 +1200 Subject: Prevent unused variable warning on Linux The base variable is only used when compiling on Windows, so an unused variable warning is raised when compiling on Linux. --- src/devices/file/bedrock_file_path.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/devices/file/bedrock_file_path.rs') diff --git a/src/devices/file/bedrock_file_path.rs b/src/devices/file/bedrock_file_path.rs index 1c702de..30aa803 100644 --- a/src/devices/file/bedrock_file_path.rs +++ b/src/devices/file/bedrock_file_path.rs @@ -174,7 +174,7 @@ fn path_to_bytes(path: &Path) -> Option> { /// Returns true if a relative path can be safely attached to a base without /// breaking out of the sandbox. -fn assert_path_is_safe(relative: &Path, base: &Path) -> Option<()> { +fn assert_path_is_safe(relative: &Path, _base: &Path) -> Option<()> { #[cfg(target_family = "unix")] { // Error if path contains special components. for component in relative.components() { @@ -189,7 +189,7 @@ fn assert_path_is_safe(relative: &Path, base: &Path) -> Option<()> { // contain the prefix and root element. If the base path is not // empty, the relative path must not contain these elements else // they will override the base path when joined. - if base.components().count() != 0 { + if _base.components().count() != 0 { for component in relative.components() { match component { Component::Normal(_) => continue, -- cgit v1.2.3-70-g09d2