tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 1117HTML 1044Markdown 12TOML 94797 Definitions

refactoring

db40f72fbfad9c9ed93cdbd9b6e2fe546abd5382 · by Adam Nemecek · (6 years ago) · parent a74a6698c · browse the tree at this commit

Semantic delta · 2

src/algo.rs

src/id.rs

  • body changed fn new pub

2 files · +3 −3

diff --git a/src/algo.rs b/src/algo.rs
index 567dcdbcb..958fa48e2 100644
--- a/src/algo.rs
+++ b/src/algo.rs
@@ -353,7 +353,7 @@ impl Forest {
             // webkit handled various scenarios. Can probably be solved better by passing in
             // min-content max-content constraints from the top
             let min_main = self
-                .compute_internal(child.node, Size { width: Undefined, height: Undefined }, available_space, false)
+                .compute_internal(child.node, Size::undefined(), available_space, false)
                 .size
                 .main(dir)
                 .maybe_max(child.min_size.main(dir))
@@ -600,7 +600,7 @@ impl Forest {
                     let min_main = if is_row && self.nodes[child.node].measure.is_none() {
                         self.compute_internal(
                             child.node,
-                            Size { width: Undefined, height: Undefined },
+                            Size::undefined(),
                             available_space,
                             false,
                         )
diff --git a/src/id.rs b/src/id.rs
index 7da241348..154d1f87d 100644
--- a/src/id.rs
+++ b/src/id.rs
@@ -16,7 +16,7 @@ pub(crate) struct Allocator {
 
 impl Allocator {
     pub const fn new() -> Self {
-        Allocator { new_id: atomic::AtomicUsize::new(0) }
+        Self { new_id: atomic::AtomicUsize::new(0) }
     }
 
     pub fn allocate(&self) -> Id {