refactor(linter): loosen lifetime requirements on RuntimeFileSystem::read_to_arena_str#18770
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Merge activity
|
There was a problem hiding this comment.
Pull request overview
This PR refactors the lifetime requirements on RuntimeFileSystem::read_to_arena_str by removing the constraint that the returned string's lifetime is tied to the RuntimeFileSystem instance. Since all implementations copy the source text into the Allocator, the lifetime of the returned &str only depends on the Allocator, not the file system object.
Changes:
- Changed trait method signature to use
&selfinstead of&'a self - Updated function parameters that use
RuntimeFileSystemto remove unnecessary'alifetime constraints - Applied changes consistently to helper functions and internal methods
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CodSpeed Performance ReportMerging this PR will not alter performanceComparing Summary
Footnotes
|
…:read_to_arena_str` (#18770) Follow-on after #17840. After that PR we can loosen the lifetime requirements on `RuntimeFileSystem::read_to_arena_str`. All implementations now read/copy the source text into `Allocator`, so `&self` no longer needs to be `&'a self` - lifetime of the returned `&str` depends only on lifetime of the `&'a Allocator`.
8e957b8 to
5f905e5
Compare

Follow-on after #17840. After that PR we can loosen the lifetime requirements on
RuntimeFileSystem::read_to_arena_str. All implementations now read/copy the source text intoAllocator, so&selfno longer needs to be&'a self- lifetime of the returned&strdepends only on lifetime of the&'a Allocator.