Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(List)!: new now accepts IntoIterator<Item = Into<ListItem>> #672

Merged
merged 1 commit into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 21 additions & 3 deletions BREAKING-CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ github with a [breaking change] label.
This is a quick summary of the sections below:

- Unreleased (0.24.1)
- `List::new()` now accepts `IntoIterator<Item = Into<ListItem<'a>>>`
- `Table::new()` now requires specifying the widths
-`Table::widths()` now accepts `IntoIterator<Item = AsRef<Constraint>>`
- `Table::widths()` now accepts `IntoIterator<Item = AsRef<Constraint>>`
- Layout::new() now accepts direction and constraint parameters
- The default `Tabs::highlight_style` is now `Style::new().reversed()`

Expand Down Expand Up @@ -40,6 +41,21 @@ This is a quick summary of the sections below:

## Unreleased (v0.24.1)

### `List::new()` now accepts `IntoIterator<Item = Into<ListItem<'a>>>` ([#672])

[#672]: https://github.com/ratatui-org/ratatui/pull/672

Previously `List::new()` took `Into<Vec<ListItem<'a>>>`. This change will throw a compilation
error for `IntoIterator`s with an indeterminate item (e.g. empty vecs).

E.g.

```rust
let list = List::new(vec![]);
// becomes
let list = List::default();
```

### The default `Tabs::highlight_style` is now `Style::new().reversed()` ([#635])

Previously the default highlight style for tabs was `Style::default()`, which meant that a `Tabs`
Expand All @@ -53,10 +69,12 @@ Previously the default highlight style for tabs was `Style::default()`, which me
widget in the default configuration would not show any indication of the selected tab.


### `Table::new()` now requires specifying the widths of the columrs (#664)
### `Table::new()` now requires specifying the widths of the columns (#664)

[#664]: https://github.com/ratatui-org/ratatui/pull/664

Previously `Table`s could be constructed without widths. In almost all cases this is an error.
A new widths parameter is now manadatory on `Table::new()`. Existing code of the form:
A new widths parameter is now mandatory on `Table::new()`. Existing code of the form:

```rust
Table::new(rows).widths(widths)
Expand Down