Skip to content

Commit

Permalink
Clippy and fmt fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cdmurph32 committed Jan 29, 2025
1 parent 571e601 commit aadf8d7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
// specific language governing permissions and limitations under
// each license.

#[cfg(not(target_os = "wasi"))]
use crate::raw_signature::webcrypto::WindowOrWorker;
use async_trait::async_trait;
#[cfg(not(target_os = "wasi"))]
use js_sys::{Array, ArrayBuffer, Object, Reflect, Uint8Array};
Expand All @@ -23,6 +21,8 @@ use wasm_bindgen_futures::JsFuture;
#[cfg(not(target_os = "wasi"))]
use web_sys::CryptoKey;

#[cfg(not(target_os = "wasi"))]
use crate::raw_signature::webcrypto::WindowOrWorker;
use crate::raw_signature::{AsyncRawSignatureValidator, RawSignatureValidationError};

/// An `EcdsaValidator` can validate raw signatures with one of the ECDSA
Expand Down
3 changes: 1 addition & 2 deletions sdk/src/asset_handlers/jpeg_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1125,12 +1125,11 @@ pub mod tests {

use std::io::{Read, Seek};

use crate::utils::io_utils::tempdirectory;

#[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))]
use wasm_bindgen_test::*;

use super::*;
use crate::utils::io_utils::tempdirectory;
#[test]
fn test_extract_xmp() {
let contents = Bytes::from_static(b"http://ns.adobe.com/xap/1.0/\0stuff");
Expand Down
11 changes: 7 additions & 4 deletions sdk/src/utils/io_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@
// specific language governing permissions and limitations under
// each license.

use std::ffi::OsStr;
use std::io::{Read, Seek, SeekFrom, Write};
use std::{
ffi::OsStr,
io::{Read, Seek, SeekFrom, Write},
};

#[allow(unused)] // different code path for WASI
use tempfile::{tempdir, Builder, NamedTempFile, TempDir};

Expand Down Expand Up @@ -150,14 +153,14 @@ pub(crate) fn tempfile_builder<T: AsRef<OsStr> + Sized>(prefix: T) -> Result<Nam
.prefix(&prefix)
.rand_bytes(5)
.tempfile_in("/")
.map_err(|e| Error::IoError(e.into()));
.map_err(Error::IoError);

#[cfg(not(target_os = "wasi"))]
return Builder::new()
.prefix(&prefix)
.rand_bytes(5)
.tempfile()
.map_err(|e| Error::IoError(e.into()));
.map_err(Error::IoError);
}

#[allow(dead_code)] // used in tests
Expand Down

0 comments on commit aadf8d7

Please sign in to comment.