Skip to content

Commit

Permalink
compile fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ccbrown committed Dec 23, 2024
1 parent accdc3a commit 64cbda3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/iocraft/src/hooks/use_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ impl<T: Copy + Sync + Send + 'static> State<T> {
impl<T: Sync + Send + 'static> State<T> {
/// Sets the value of the state.
pub fn set(&mut self, value: T) {
if let Some(v) = self.try_write() {
if let Some(mut v) = self.try_write() {
*v = value;
}
}
Expand Down Expand Up @@ -263,7 +263,7 @@ impl<T: ops::Add<Output = T> + Copy + Sync + Send + 'static> ops::Add<T> for Sta

impl<T: ops::AddAssign<T> + Copy + Sync + Send + 'static> ops::AddAssign<T> for State<T> {
fn add_assign(&mut self, rhs: T) {
if let Some(v) = self.try_write() {
if let Some(mut v) = self.try_write() {
*v += rhs;
}
}
Expand All @@ -279,7 +279,7 @@ impl<T: ops::Sub<Output = T> + Copy + Sync + Send + 'static> ops::Sub<T> for Sta

impl<T: ops::SubAssign<T> + Copy + Sync + Send + 'static> ops::SubAssign<T> for State<T> {
fn sub_assign(&mut self, rhs: T) {
if let Some(v) = self.try_write() {
if let Some(mut v) = self.try_write() {
*v -= rhs;
}
}
Expand All @@ -295,7 +295,7 @@ impl<T: ops::Mul<Output = T> + Copy + Sync + Send + 'static> ops::Mul<T> for Sta

impl<T: ops::MulAssign<T> + Copy + Sync + Send + 'static> ops::MulAssign<T> for State<T> {
fn mul_assign(&mut self, rhs: T) {
if let Some(v) = self.try_write() {
if let Some(mut v) = self.try_write() {
*v *= rhs;
}
}
Expand All @@ -311,7 +311,7 @@ impl<T: ops::Div<Output = T> + Copy + Sync + Send + 'static> ops::Div<T> for Sta

impl<T: ops::DivAssign<T> + Copy + Sync + Send + 'static> ops::DivAssign<T> for State<T> {
fn div_assign(&mut self, rhs: T) {
if let Some(v) = self.try_write() {
if let Some(mut v) = self.try_write() {
*v /= rhs;
}
}
Expand Down

0 comments on commit 64cbda3

Please sign in to comment.