chore: fix the method name for setting the Line style (#947)

This commit is contained in:
Orhun Parmaksız 2024-02-12 12:53:46 +03:00 committed by GitHub
parent 1f208ffd03
commit 18870ce990
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -154,7 +154,7 @@ longer can be called from a constant context.
[#708]: https://github.com/ratatui-org/ratatui/pull/708
Previously the style of a `Line` was stored in the `Span`s that make up the line. Now the `Line`
itself has a `style` field, which can be set with the `Line::style` method. Any code that creates
itself has a `style` field, which can be set with the `Line::styled` method. Any code that creates
`Line`s using the struct initializer instead of constructors will fail to compile due to the added
field. This can be easily fixed by adding `..Default::default()` to the field list or by using a
constructor method (`Line::styled()`, `Line::raw()`) or conversion method (`Line::from()`).