Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PlamenHristov committed Jun 13, 2024
1 parent 9f2f67a commit 29e318b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/wasm/tomb_compat/wasm_fs_metadata_entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use wasm_bindgen::prelude::*;
use crate::codec::filesystem::NodeKind;
use crate::filesystem::nodes::NodeName;
use crate::filesystem::DirectoryEntry;
#[cfg(feature = "mime-type")]
use crate::prelude::nodes::MetadataKey;

use super::BanyanFsError;
Expand Down Expand Up @@ -70,9 +71,8 @@ impl TryFrom<DirectoryEntry> for WasmFsMetadataEntry {
.map_err(|_| "failed to convert size")?;

#[cfg(feature = "mime-type")]
let js_key = JsValue::from_str(MetadataKey::MimeType);
if let Some(mime_type) = dir_entry.mime_type() {
js_sys::Reflect::set(&metadata, &js_key, &JsValue::from_str(mime_type.to_string()))
js_sys::Reflect::set(&metadata, &sValue::from_str(MetadataKey::MimeType), &JsValue::from_str(mime_type.to_string()))
.map_err(|_| "failed to convert mime_type")?;
}

Expand Down

0 comments on commit 29e318b

Please sign in to comment.