Skip to content

Commit

Permalink
Fix unused Permissions import lint warning on Windows (#120)
Browse files Browse the repository at this point in the history
The use of this type is behind a `cfg(unix)`, resulting in unused
imports on Windows.
  • Loading branch information
MarijnS95 authored Aug 22, 2023
1 parent 875f933 commit 9e58a8a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions appimage/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::{Context, Result};
use std::fs::{File, Permissions};
use std::fs::File;
use std::io::{BufReader, BufWriter, Write};
#[cfg(unix)]
use std::os::unix::fs::PermissionsExt;
Expand Down Expand Up @@ -95,7 +95,7 @@ impl AppImage {
let mut squashfs = BufReader::new(File::open(squashfs)?);
let mut f = File::create(out)?;
#[cfg(unix)]
f.set_permissions(Permissions::from_mode(0o755))?;
f.set_permissions(std::fs::Permissions::from_mode(0o755))?;
let mut out = BufWriter::new(&mut f);
out.write_all(RUNTIME)?;
std::io::copy(&mut squashfs, &mut out)?;
Expand Down
4 changes: 2 additions & 2 deletions xcommon/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use image::{DynamicImage, GenericImageView, ImageOutputFormat, RgbaImage};
use rsa::pkcs8::DecodePrivateKey;
use rsa::{PaddingScheme, RsaPrivateKey, RsaPublicKey};
use sha2::{Digest, Sha256};
use std::fs::{File, OpenOptions, Permissions};
use std::fs::{File, OpenOptions};
use std::io::{Cursor, Read, Seek, SeekFrom, Write};
use std::path::{Path, PathBuf};
use zip::write::FileOptions;
Expand Down Expand Up @@ -450,7 +450,7 @@ pub fn extract_zip(archive: &Path, directory: &Path) -> Result<()> {
{
use std::os::unix::fs::PermissionsExt;
if let Some(mode) = file.unix_mode() {
std::fs::set_permissions(&outpath, Permissions::from_mode(mode))?;
std::fs::set_permissions(&outpath, std::fs::Permissions::from_mode(mode))?;
}
}
}
Expand Down

0 comments on commit 9e58a8a

Please sign in to comment.