tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

HTML 5544Rust 88Markdown 11TOML 91926 Definitions

Add from impl to TaffyStyloStyle

c472dbf31c53694f9a665435c1a969e1786d643f · by Nico Burns · (2 years ago) · parent 20b284300 · browse the tree at this commit

Semantic delta · 1

taffy_stylo/src/lib.rs

1 files · +6 −0

diff --git a/taffy_stylo/src/lib.rs b/taffy_stylo/src/lib.rs
index 8fff48a99..1b9d13a84 100644
--- a/taffy_stylo/src/lib.rs
+++ b/taffy_stylo/src/lib.rs
@@ -37,6 +37,12 @@ mod stylo {
 
 pub struct TaffyStyloStyle(pub Arc<stylo::ComputedValues>);
 
+impl From<Arc<stylo::ComputedValues>> for TaffyStyloStyle {
+    fn from(value: Arc<stylo::ComputedValues>) -> Self {
+        Self(Arc::clone(&value))
+    }
+}
+
 impl taffy::CoreStyle for TaffyStyloStyle {
     #[inline]
     fn box_generation_mode(&self) -> taffy::BoxGenerationMode {