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

Replace PathBuf/Utf8PathBuf with Path/Utf8Path when ownership not needed #4440

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

Integral-Tech
Copy link
Contributor

@Integral-Tech Integral-Tech commented Dec 19, 2024

  • Using &Path/&Utf8Path as function parameter type provides better generality over &PathBuf/&Utf8PathBuf, as it can accept both &Path/&Utf8Path and &PathBuf/&Utf8PathBuf.

  • When it comes to constructor, Path::new() doesn't introduce overhead of heap allocation, while PathBuf::from() does.

  • Public API changes documented in changelogs (optional)

@Integral-Tech Integral-Tech requested a review from a team as a code owner December 19, 2024 11:29
@Integral-Tech Integral-Tech requested review from bnjbvr and removed request for a team December 19, 2024 11:29
@Integral-Tech Integral-Tech force-pushed the refactor-pathbuf branch 2 times, most recently from fd99d78 to 48db14f Compare December 19, 2024 11:33
Copy link

codecov bot commented Dec 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.43%. Comparing base (de56883) to head (17d5186).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4440      +/-   ##
==========================================
+ Coverage   85.40%   85.43%   +0.02%     
==========================================
  Files         283      283              
  Lines       31490    31490              
==========================================
+ Hits        26895    26902       +7     
+ Misses       4595     4588       -7     

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

Copy link
Member

@bnjbvr bnjbvr left a comment

Choose a reason for hiding this comment

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

Great, thanks!

@bnjbvr bnjbvr merged commit f18e0b1 into matrix-org:main Dec 19, 2024
40 checks passed
@Integral-Tech Integral-Tech deleted the refactor-pathbuf branch December 19, 2024 12:35
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