Skip to content

Commit b812fce

Browse files
committed
Small typo fixes
1 parent 6d4fdbf commit b812fce

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

docs/src/02_getting_started.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ To complete our todo-list, we need to change our app data type. Instead of just
181181
{{#include ../book_examples/src/getting_started_2_md.rs:example_6_struct}}
182182
```
183183

184-
However, now we have a problem: our List widget which expected a `Vector<...>` won't know how to handle a struct. So, we need to modify druid's dataflow so that, given the TodoList above, the List widget will have access to the `items` field. This is done with a `Lens`, which we'll explain next chapter.
184+
However, now we have a problem: our List widget which expected a `Vector<...>` won't know how to handle a struct. So, we need to modify Druid's dataflow so that, given the TodoList above, the List widget will have access to the `items` field. This is done with a `Lens`, which we'll explain next chapter.
185185

186186
Furthermore, to pass our type as the a generic parameter to `Widget`, we need it to implement the `Data` trait (and `Clone`), more on that next chapter.
187187

docs/src/03_data.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Some widgets (eg Button, TextBox, Checkbox) can mutate the data passed to them b
88

99
When you mutate a widget's associated data, Druid compares the old and new version, and propagates the change to the widgets that are affected by the change.
1010

11-
Note that, in all that workflow, Widgets don't actually store their associated data. A `Button<Vector<String>>` doesn't actually store a `Vector<String>`, the framework just stores one which is provided to the button.
11+
Note that, in all that workflow, Widgets don't actually store their associated data. A `Button<Vector<String>>` doesn't actually store a `Vector<String>`, instead the framework stores one per button, which is provided to widget methods.
1212

1313
For this to work, your model must implement the `Clone` and `Data` traits. The `Data` trait has a single method:
1414

@@ -21,7 +21,7 @@ This method checks for equality, but allows for false negatives.
2121

2222
## Performance
2323

24-
It is important that your data be cheap to clone and cheap to compare; we encourage the use of reference counted pointers to allow cheap cloning of more expensive types. `Arc` and `Rc` have blanket `Data` impls that do pointer comparison, so if you have a type that does not implement `Data`, you can always just wrap it in one of those smart pointers.
24+
It is important that your data is cheap to clone and cheap to compare; we encourage the use of reference counted pointers to allow cheap cloning of more expensive types. `Arc` and `Rc` have blanket `Data` impls that do pointer comparison, so if you have a type that does not implement `Data`, you can always just wrap it in one of those smart pointers.
2525

2626
### Collections
2727

@@ -31,7 +31,7 @@ issues with collection types. For this reason, `Data` is not implemented for
3131

3232
You can always put these types inside an `Rc` or an `Arc`, or if you're dealing with
3333
larger collections you can build Druid with the `im` feature, which brings in
34-
the [`im crate`], and adds a `Data` impl for the collections there. The [`im`
34+
the [`im` crate], and adds a `Data` impl for the collections there. The [`im`
3535
crate] is a collection of immutable data structures that act a lot like the `std`
3636
collections, but can be cloned efficiently.
3737

@@ -58,7 +58,7 @@ Here is an example of using `Data` to implement a simple data model:
5858

5959
In Druid, most container widgets expect their children to have the same associated data. If you have a `Flex<Foobar>`, you can only append widgets that implement `Widget<Foobar>` to it.
6060

61-
In some cases, however, you want compose widgets that operate on different subsets of the data. Maybe you want to add two widgets to the above Flex, one that uses the field `foo` and another that uses the field `bar`, and they might respectively implement `Widget<Foo>` and `Widget<Bar>`.
61+
In some cases, however, you want to compose widgets that operate on different subsets of the data. Maybe you want to add two widgets to the above Flex, one that uses the field `foo` and another that uses the field `bar`, and they might respectively implement `Widget<Foo>` and `Widget<Bar>`.
6262

6363
Lenses allow you to bridge that type difference. A lens is a type that represents a *two-way* mapping between two data types. That is, a lens from X to Y can take an instance of X and give you an instance of Y, and can take a modified Y and apply the modification to X.
6464

druid/src/core.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,8 @@ impl<T, W: Widget<T>> WidgetPod<T, W> {
232232
/// with behavior similar to a button will call [`set_active`] on mouse
233233
/// down and then up.
234234
///
235-
/// The active status can only be set manually. Druid doesn't eg automatically
236-
/// set it to false on mouse release.
235+
/// The active status can only be set manually. Druid doesn't automatically
236+
/// set it to `false` on mouse release or anything like that.
237237
///
238238
/// There is no special handling of the active status for multi-pointer devices.
239239
///

druid/src/widget/flex.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ impl<T: Data> Flex<T> {
571571
flex: params.flex,
572572
}
573573
} else {
574-
tracing::warn!("Flex value should be > 0.0. To add a non-flex child use the add_child or with_child methods.\nSee the docs for more information: https://docs.rs/druid/latest/druid/widget/struct.Flex.html");
574+
tracing::warn!("Flex value should be > 0.0. To add a non-flex child use the add_child or with_child methods.\nSee the docs for more information: https://docs.rs/druid/0.8.0/druid/widget/struct.Flex.html");
575575
Child::Fixed {
576576
widget: WidgetPod::new(Box::new(child)),
577577
alignment: None,

0 commit comments

Comments
 (0)