Skip to content

Clean up API in preparation for future 2.0 release#15

Merged
mbrubeck merged 3 commits into
servo:masterfrom
mbrubeck:api
Feb 5, 2021
Merged

Clean up API in preparation for future 2.0 release#15
mbrubeck merged 3 commits into
servo:masterfrom
mbrubeck:api

Conversation

@mbrubeck

@mbrubeck mbrubeck commented Feb 5, 2021

Copy link
Copy Markdown
Collaborator

Change the names of a couple of methods to be consistent with other Rust libraries.

  • Rename num_entries to len.
  • Rename evict_all to clear.

The old names are still available but marked as deprecated. They will be removed in the next major release.

Also mark front and front_mut as deprecated. These methods are not useful for external code, and will be made private in the next major release.

Change the names of these methods to be more consistent with other Rust
libraries.  The old names are still available but marked as deprecated.
They will be removed in the next major release.
These methods are not useful for external code, and will be made private
in the next major release.
@mbrubeck mbrubeck force-pushed the api branch 2 times, most recently from b0b7f55 to f77340e Compare February 5, 2021 17:32
@jdm

jdm commented Feb 5, 2021

Copy link
Copy Markdown
Member

What's the purpose of the 1.1.0 change? Otherwise this looks fine.

@mbrubeck

mbrubeck commented Feb 5, 2021

Copy link
Copy Markdown
Collaborator Author

What's the purpose of the 1.1.0 change? Otherwise this looks fine.

I'd like to publish a release with this change, and I wanted to remember to bump the minor version because this adds new public methods.

@jdm

jdm commented Feb 5, 2021

Copy link
Copy Markdown
Member

Oops, I definitely misread the change. Looks good!

@mbrubeck mbrubeck merged commit ca1af85 into servo:master Feb 5, 2021
@mbrubeck

mbrubeck commented Feb 6, 2021

Copy link
Copy Markdown
Collaborator Author

Note: I pushed a quick fix to revert the deprecation of front and front_mut. I did this because, after releasing this change, I tried to update badgen to avoid the deprecated methods, and discovered that there is no way to convert this code to use find until Polonius is stabilized:

https://github.com/avitex/rust-badgen/blob/7dc43ee5c85d5f9c646d98381140afcda105567a/src/font.rs#L92-L93

I'd still like to remove these methods in a future release, but it will have to wait.

@mbrubeck mbrubeck removed the request for review from jdm February 6, 2021 01:03
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.

2 participants