diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index ac28a71..9c63dcf 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -13,6 +13,7 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v4 + - uses: ilammy/setup-nasm@v1 - uses: dtolnay/rust-toolchain@stable with: diff --git a/src/file.rs b/src/file.rs index 6eab3cb..8f9b14c 100644 --- a/src/file.rs +++ b/src/file.rs @@ -53,7 +53,7 @@ fn exists(path: &str) -> String { path.exists().to_string() } -fn write(data: &str, path: &str, base64decode: bool) -> Result { +fn write(data: &str, path: &str, base64decode: bool) -> Result<()> { let path: &std::path::Path = path.as_ref(); if let Some(parent) = path.parent() { std::fs::create_dir_all(parent)?; @@ -61,15 +61,15 @@ fn write(data: &str, path: &str, base64decode: bool) -> Result { let mut file = BufWriter::new(File::create(path)?); - let written = if base64decode { - file.write( + if base64decode { + file.write_all( base64::prelude::BASE64_STANDARD .decode(data) .unwrap() .as_ref(), )? } else { - file.write(data.as_bytes())? + file.write_all(data.as_bytes())? }; file.flush()?; @@ -77,7 +77,7 @@ fn write(data: &str, path: &str, base64decode: bool) -> Result { .map_err(|e| std::io::Error::new(e.error().kind(), e.error().to_string()))? // This is god-awful, but the compiler REFUSES to let me get an owned copy of `e` .sync_all()?; - Ok(written) + Ok(()) } fn append(data: &str, path: &str) -> Result { diff --git a/src/lib.rs b/src/lib.rs index d028abf..d8d2038 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,5 @@ // #![forbid(unsafe_op_in_unsafe_fn)] - see github.com/rust-lang/rust/issues/121483 - +#![allow(clippy::thread_local_initializer_can_be_made_const)] #[macro_use] mod byond; #[allow(dead_code)]