[PR #64] [MERGED] Refactor ~ use Path/PathBuf instead of &str/String #284

Closed
opened 2026-06-08 11:26:46 +03:00 by zhus · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bootandy/dust/pull/64
Author: @rivy
Created: 2/4/2020
Status: Merged
Merged: 2/9/2020
Merged by: @bootandy

Base: masterHead: rf.path


📝 Commits (2)

  • 9d4531d Refactor ~ use PathBuf instead of String
  • a3d8fc0 Refactor ~ use AsRef<Path> where possible

📊 Changes

4 files changed (+104 additions, -100 deletions)

View changed files

📝 src/display.rs (+17 -11)
📝 src/main.rs (+7 -3)
📝 src/utils/mod.rs (+77 -84)
📝 src/utils/platform.rs (+3 -2)

📄 Description

This minimizes the string conversion/copy "fiddliness" and helps somewhat in code comprehension and maintaining/encouraging cross-platform compatibility.

There may be some additional work to be done with references, especially in the containers, that might be useful to further minimize copying. But it's a bit beyond my understanding of the language at the moment to go beyond this point.

Let me know if this is helpful, and if so, whether you'd like any changes.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bootandy/dust/pull/64 **Author:** [@rivy](https://github.com/rivy) **Created:** 2/4/2020 **Status:** ✅ Merged **Merged:** 2/9/2020 **Merged by:** [@bootandy](https://github.com/bootandy) **Base:** `master` ← **Head:** `rf.path` --- ### 📝 Commits (2) - [`9d4531d`](https://github.com/bootandy/dust/commit/9d4531d48b3e5941cbc816000d76d3f5648a3a88) Refactor ~ use PathBuf instead of String - [`a3d8fc0`](https://github.com/bootandy/dust/commit/a3d8fc00e1946388c3e77ad7d26c0872c358bd53) Refactor ~ use `AsRef<Path>` where possible ### 📊 Changes **4 files changed** (+104 additions, -100 deletions) <details> <summary>View changed files</summary> 📝 `src/display.rs` (+17 -11) 📝 `src/main.rs` (+7 -3) 📝 `src/utils/mod.rs` (+77 -84) 📝 `src/utils/platform.rs` (+3 -2) </details> ### 📄 Description This minimizes the string conversion/copy "fiddliness" and helps somewhat in code comprehension and maintaining/encouraging cross-platform compatibility. There may be some additional work to be done with references, especially in the containers, that might be useful to further minimize copying. But it's a bit beyond my understanding of the language at the moment to go beyond this point. Let me know if this is helpful, and if so, whether you'd like any changes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
zhus added the pull-request label 2026-06-08 11:26:46 +03:00
zhus closed this issue 2026-06-08 11:26:47 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bootandy/archived-dust#284