fix empty docs clippy warning

This commit is contained in:
Evan Almloff 2024-05-03 13:41:48 -05:00
parent 010dcf9533
commit 05eaca320f
3 changed files with 4 additions and 3 deletions

View file

@ -17,6 +17,7 @@ use std::{
/// ///
/// NOTE: WASM currently does not support caching unwinds, so this struct will not be created in WASM. /// NOTE: WASM currently does not support caching unwinds, so this struct will not be created in WASM.
pub struct CapturedPanic { pub struct CapturedPanic {
#[allow(dead_code)]
/// The error that was caught /// The error that was caught
pub error: Box<dyn Any + 'static>, pub error: Box<dyn Any + 'static>,
} }
@ -90,7 +91,7 @@ impl Error for CapturedError {}
impl CapturedError { impl CapturedError {
/// Downcast the error type into a concrete error type /// Downcast the error type into a concrete error type
pub fn downcast<T: 'static>(&self) -> Option<&T> { pub fn downcast<T: 'static>(&self) -> Option<&T> {
if TypeId::of::<T>() == self.error.type_id() { if TypeId::of::<T>() == (*self.error).type_id() {
self.error.as_any().downcast_ref::<T>() self.error.as_any().downcast_ref::<T>()
} else { } else {
None None

View file

@ -3,7 +3,7 @@ use rustc_hash::FxHashMap;
use std::{cell::RefCell, rc::Rc}; use std::{cell::RefCell, rc::Rc};
use wry::{http::Request, RequestAsyncResponder}; use wry::{http::Request, RequestAsyncResponder};
/// /// A request for an asset within dioxus-desktop.
pub type AssetRequest = Request<Vec<u8>>; pub type AssetRequest = Request<Vec<u8>>;
pub struct AssetHandler { pub struct AssetHandler {

View file

@ -1,6 +1,6 @@
use dioxus_core::{prelude::provide_root_context, prelude::try_consume_context, use_hook}; use dioxus_core::{prelude::provide_root_context, prelude::try_consume_context, use_hook};
/// /// Try to get a value from the root of the virtual dom, if it doesn't exist, create a new one with the closure provided.
pub fn use_root_context<T: 'static + Clone>(new: impl FnOnce() -> T) -> T { pub fn use_root_context<T: 'static + Clone>(new: impl FnOnce() -> T) -> T {
use_hook(|| { use_hook(|| {
try_consume_context::<T>() try_consume_context::<T>()