FileIdCache: Allow flexible handle instead of direct borrow for file ids#664
FileIdCache: Allow flexible handle instead of direct borrow for file ids#664dfaust merged 2 commits intonotify-rs:mainfrom
Conversation
|
I'm split on this. |
|
I changed the impl from I see no downside to allow a impl return. They are zero cost at runtime. As far as I see the change is backwards compatible. |
I am unfamiliar with the process. Should I just add the change at the top of the .md without a version / date? |
Yes. Add it under |
|
Done. I opted for a simpler description for the change in the changelog. Note that |
|
Thanks. |
Hi,
I suggest changing the return type of the
cached_file_idmethod in theFileIdCachefromOption<&FileId>toOption<impl Deref<Target=FileId>>;(breaking change)This allows trait consumers to choose more freely how to return the FileId.
In a FileIdCache implementation I had to do I was required to return a owned copy of the file id.
The changed return type allows eg. a Cow::Owned or any other new-type implementation that dereferences to a FileId.
This is now doable with the recent MSRV raise to 1.77.