diff options
author | Ben Bridle <bridle.benjamin@gmail.com> | 2024-08-11 12:38:13 +1200 |
---|---|---|
committer | Ben Bridle <bridle.benjamin@gmail.com> | 2024-08-11 12:38:13 +1200 |
commit | 68f633f6ba35a4fbbae9ed22fc759ce3544f6a0e (patch) | |
tree | d7d72f1c792d6d75fcffd352a979ab23dc4e167b /src | |
parent | 9ad823bc3010616144e376377cc1a16b7787e4e0 (diff) | |
download | bedrock-pc-68f633f6ba35a4fbbae9ed22fc759ce3544f6a0e.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/devices/file/bedrock_file_path.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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<Vec<u8>> { /// 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, |