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(span): rename to_aligned_line into into_aligned_line #993

Merged
merged 1 commit into from Mar 22, 2024

Conversation

EdJoPaTo
Copy link
Member

@EdJoPaTo EdJoPaTo commented Mar 22, 2024

With the Rust method naming conventions these methods are into methods
consuming the Span. Therefore, it's more consistent to use into_
instead of to_.

Span::to_centered_line
Span::to_left_aligned_line
Span::to_right_aligned_line

Are marked deprecated and replaced with the following

Span::into_centered_line
Span::into_left_aligned_line
Span::into_right_aligned_line

This deprecates the old methods hinting the new name.

With the Rust method naming conventions this method is an into method
consuming the Span. Therefore, it's more consistent to name it into
instead of to.
Copy link

codecov bot commented Mar 22, 2024

Codecov Report

Attention: Patch coverage is 40.00000% with 9 lines in your changes are missing coverage. Please review.

Project coverage is 89.3%. Comparing base (f6c4e44) to head (db62d49).

Files Patch % Lines
src/text/span.rs 40.0% 9 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main    #993     +/-   ##
=======================================
- Coverage   89.4%   89.3%   -0.1%     
=======================================
  Files         61      61             
  Lines      15286   15295      +9     
=======================================
  Hits       13668   13668             
- Misses      1618    1627      +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@joshka joshka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - will merge with a minor addition to the commit message (naming the specific methods changed to make the changelog searchable)

@joshka joshka merged commit 8719608 into main Mar 22, 2024
32 of 33 checks passed
@joshka joshka deleted the span-to-into-aligned branch March 22, 2024 11:29
@EdJoPaTo
Copy link
Member Author

I updated the PR text too as the commit links there and people might look there for context. (I think it’s the easier way to update the PR message and then merge with the updated message)

@joshka
Copy link
Member

joshka commented Mar 22, 2024

I updated the PR text too as the commit links there and people might look there for context. (I think it’s the easier way to update the PR message and then merge with the updated message)

+1 Good call :)

joshka pushed a commit to nowNick/ratatui that referenced this pull request May 24, 2024
…i-org#993)

With the Rust method naming conventions these methods are into methods
consuming the Span. Therefore, it's more consistent to use `into_`
instead of `to_`.

```rust
Span::to_centered_line
Span::to_left_aligned_line
Span::to_right_aligned_line
```

Are marked deprecated and replaced with the following

```rust
Span::into_centered_line
Span::into_left_aligned_line
Span::into_right_aligned_line
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants