Prechádzať zdrojové kódy

fix hooks release build

Evan Almloff 1 rok pred
rodič
commit
79e18c2d62

+ 4 - 2
packages/desktop/src/app.rs

@@ -18,7 +18,7 @@ use std::{
     sync::Arc,
 };
 use tao::{
-    dpi::{PhysicalPosition, PhysicalSize},
+    dpi::PhysicalSize,
     event::Event,
     event_loop::{ControlFlow, EventLoop, EventLoopBuilder, EventLoopProxy, EventLoopWindowTarget},
     window::WindowId,
@@ -478,7 +478,9 @@ impl App {
                     let window = &webview.desktop_context.window;
                     let position = (state.x, state.y);
                     let size = (state.width, state.height);
-                    window.set_outer_position(PhysicalPosition::new(position.0, position.1));
+                    window.set_outer_position(tao::dpi::PhysicalPosition::new(
+                        position.0, position.1,
+                    ));
                     window.set_inner_size(PhysicalSize::new(size.0, size.1));
                 }
             }

+ 1 - 8
packages/hooks/src/use_signal.rs

@@ -84,7 +84,6 @@ pub fn use_signal_sync<T: Send + Sync + 'static>(f: impl FnOnce() -> T) -> Signa
 fn use_maybe_signal_sync<T: 'static, U: Storage<SignalData<T>>>(
     f: impl FnOnce() -> T,
 ) -> Signal<T, U> {
-    #[cfg(debug_assertions)]
     let caller = std::panic::Location::caller();
 
     // todo: (jon)
@@ -92,11 +91,5 @@ fn use_maybe_signal_sync<T: 'static, U: Storage<SignalData<T>>>(
     // any calls to .read() in the body will re-subscribe the component to the signal
     // use_before_render(move || signal.unsubscribe(current_scope_id().unwrap()));
 
-    use_hook(|| {
-        Signal::new_with_caller(
-            f(),
-            #[cfg(debug_assertions)]
-            caller,
-        )
-    })
+    use_hook(|| Signal::new_with_caller(f(), caller))
 }

+ 1 - 0
packages/signals/src/signal.rs

@@ -165,6 +165,7 @@ impl<T: 'static, S: Storage<SignalData<T>>> Signal<T, S> {
     ///     use_hook(move || Signal::new_with_caller(function(), caller))
     /// }
     /// ```
+    #[allow(unused)]
     pub fn new_with_caller(value: T, caller: &'static std::panic::Location<'static>) -> Self {
         Self {
             inner: CopyValue::new_with_caller(