gioser

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 684HTML 640Markdown 12TOML 62286 Definiciones

fix description in traits.rs (#731)

* fix description in traits.rs

* add file comment for partial example

a166049628f57f0e3c9851d4505a5e6d28627d00 · por Erik Sandrén · (hace 1 año) · padre 02453b2c4 · ver el árbol en este commit

Delta semántico

Ninguna definición cambió: el cambio es de texto, documentación o datos.

2 archivos · +8 −1

diff --git a/examples/custom_tree_owned_partial.rs b/examples/custom_tree_owned_partial.rs
index da77f3318..9aca52cd4 100644
--- a/examples/custom_tree_owned_partial.rs
+++ b/examples/custom_tree_owned_partial.rs
@@ -1,3 +1,10 @@
+//! ## Example: Partial Tree with Directly Owned Children
+//!
+//! The following example demonstrate an implementation of Taffy's Partial trait and usage of the low-level compute APIs.
+//! This example uses directly owned children with NodeId's being index's into vec on parent node.
+//! Since an iterator created from a node can't access grandchildren, we are limited to only implement `TraversePartialTree`.
+//! See the [`crate::tree::traits`] module for more details about the low-level traits.
+
 mod common {
     pub mod image;
     pub mod text;
diff --git a/src/tree/traits.rs b/src/tree/traits.rs
index 07fd6477a..2642b0749 100644
--- a/src/tree/traits.rs
+++ b/src/tree/traits.rs
@@ -5,7 +5,7 @@
 //! The following examples demonstrate end-to-end implementation of Taffy's traits and usage of the low-level compute APIs:
 //!
 //!   - [custom_tree_vec](https://github.com/DioxusLabs/taffy/blob/main/examples/custom_tree_vec.rs) which implements a custom Taffy tree using a `Vec` as an arena with NodeId's being index's into the Vec.
-//!   - [custom_tree_owned_partial](https://github.com/DioxusLabs/taffy/blob/main/examples/custom_tree_owned_partial.rs) which implements a custom Taffy tree using directly owned children with NodeId's being pointers.
+//!   - [custom_tree_owned_partial](https://github.com/DioxusLabs/taffy/blob/main/examples/custom_tree_owned_partial.rs) which implements a custom Taffy tree using directly owned children with NodeId's being index's into vec on parent node.
 //!   - [custom_tree_owned_unsafe](https://github.com/DioxusLabs/taffy/blob/main/examples/custom_tree_owned_unsafe.rs) which implements a custom Taffy tree using directly owned children with NodeId's being pointers.
 //!
 //! ## Overview