remove the file engine feature in the html crate (#3392)

This commit is contained in:
Evan Almloff authored and GitHub committed 2024-12-20 12:00:03 -08:00
1 parent c2952a79f8
commit aab1258f0e
9 files changed
+65 -66

No files matched your search

+18 -12
View File
@@ -106,21 +106,27 @@ impl HasFormData for WebFormData {
}
impl HasFileData for WebFormData {
#[cfg(feature = "file_engine")]
fn files(&self) -> Option<std::sync::Arc<dyn dioxus_html::FileEngine>> {
let files = self
.element
.dyn_ref()
.and_then(|input: &web_sys::HtmlInputElement| {
input.files().and_then(|files| {
#[allow(clippy::arc_with_non_send_sync)]
crate::file_engine::WebFileEngine::new(files).map(|f| {
std::sync::Arc::new(f) as std::sync::Arc<dyn dioxus_html::FileEngine>
#[cfg(feature = "file_engine")]
{
let files = self
.element
.dyn_ref()
.and_then(|input: &web_sys::HtmlInputElement| {
input.files().and_then(|files| {
#[allow(clippy::arc_with_non_send_sync)]
crate::file_engine::WebFileEngine::new(files).map(|f| {
std::sync::Arc::new(f) as std::sync::Arc<dyn dioxus_html::FileEngine>
})
})
})
});
});
files
files
}
#[cfg(not(feature = "file_engine"))]
{
None
}
}
}