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

refactor(style): Mark some Style fns const so they can be defined globally #115

Merged
merged 1 commit into from
Mar 24, 2023

Conversation

kpcyrd
Copy link
Contributor

@kpcyrd kpcyrd commented Mar 24, 2023

This allows writing:

const WHITE: Style = Style::new().fg(Color::White);

outside of a function. I can't mark Style::default() as const because it's from a trait.

@mindoodoo mindoodoo requested a review from orhun March 24, 2023 14:00
@mindoodoo mindoodoo added the enhancement New feature or request label Mar 24, 2023
@mindoodoo mindoodoo changed the title Mark some Style fns const so they can be defined globally refactor(style): Mark some Style fns const so they can be defined globally Mar 24, 2023
@mindoodoo mindoodoo merged commit 21a029f into ratatui-org:main Mar 24, 2023
@kpcyrd kpcyrd deleted the const-style branch March 24, 2023 17:13
a-kenji added a commit to a-kenji/ratatui that referenced this pull request Jun 24, 2023
Mark functions of `structs` that suit themselves to be composed as const,
namely:

- `Block`
- `Layout`
- `Rect`

Continuation of: ratatui-org#115
a-kenji added a commit to a-kenji/ratatui that referenced this pull request Jun 24, 2023
Mark functions of `structs` that suit themselves to be composed as const,
namely:

- `Block`
- `Layout`
- `Rect`

Continuation of: ratatui-org#115
a-kenji added a commit to a-kenji/ratatui that referenced this pull request Jun 24, 2023
Mark functions of `structs` that suit themselves to be composed as const,
namely:

- `Block`
- `Layout`
- `Rect`

Continuation of: ratatui-org#115
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants