Skip to content

Commit

Permalink
Add support for use/static for the owned String (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
maciejhirsz authored Apr 15, 2024
1 parent e4518a0 commit f6ed313
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions crates/kobold/src/diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,20 @@ macro_rules! impl_no_diff {
self.0
}
}

impl View for $name<String> {
type Product = Node;

fn build(self, p: In<Self::Product>) -> Out<Self::Product> {
p.put(self.into_text())
}

fn update(self, p: &mut Self::Product) {
if $update {
self.0.set_prop(TextContent, p);
}
}
}
};
}

Expand Down

0 comments on commit f6ed313

Please sign in to comment.