fix hooks release build

This commit is contained in:
Evan Almloff 2024-06-10 07:41:15 -05:00
parent 689ac5433f
commit 79e18c2d62
3 changed files with 6 additions and 10 deletions

View file

@ -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));
}
}

View file

@ -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))
}

View file

@ -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(