Skip to content

Commit

Permalink
Prepare 0.8.1 (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
maciejhirsz authored Apr 30, 2023
1 parent c9b3e09 commit bb6c23c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/kobold/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "kobold"
version = "0.8.0"
version = "0.8.1"
authors = ["Maciej Hirsz <[email protected]>"]
edition = "2021"
license = "MPL-2.0"
Expand Down
6 changes: 3 additions & 3 deletions crates/kobold/src/stateful/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ impl<T> WithCell<T> {
}
}

pub fn with<F, R>(&self, mutator: F) -> R
pub fn with<F, O>(&self, mutator: F) -> O
where
F: FnOnce(&mut T) -> R,
R: 'static,
F: FnOnce(&mut T) -> O,
O: 'static,
{
if self.borrowed.get() {
wasm_bindgen::throw_str("Cyclic state borrowing");
Expand Down
4 changes: 2 additions & 2 deletions crates/kobold/src/stateful/hook.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ impl<S> Signal<S> {
O: ShouldRender,
{
if let Some(inner) = self.weak.upgrade() {
if inner.state.with(|state| mutator(state)).should_render() {
if inner.state.with(mutator).should_render() {
inner.update()
}
}
Expand All @@ -68,7 +68,7 @@ impl<S> Signal<S> {
F: FnOnce(&mut S),
{
if let Some(inner) = self.weak.upgrade() {
inner.state.with(move |state| mutator(state));
inner.state.with(mutator);
}
}

Expand Down

0 comments on commit bb6c23c

Please sign in to comment.