Browse Source

fix empty docs clippy warning

Evan Almloff 1 năm trước cách đây
mục cha
commit
05eaca320f

+ 2 - 1
packages/core/src/error_boundary.rs

@@ -17,6 +17,7 @@ use std::{
 ///
 /// NOTE: WASM currently does not support caching unwinds, so this struct will not be created in WASM.
 pub struct CapturedPanic {
+    #[allow(dead_code)]
     /// The error that was caught
     pub error: Box<dyn Any + 'static>,
 }
@@ -90,7 +91,7 @@ impl Error for CapturedError {}
 impl CapturedError {
     /// Downcast the error type into a concrete error type
     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>()
         } else {
             None

+ 1 - 1
packages/desktop/src/assets.rs

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

+ 1 - 1
packages/hooks/src/use_root_context.rs

@@ -1,6 +1,6 @@
 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 {
     use_hook(|| {
         try_consume_context::<T>()