mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-01-11 14:40:25 +01:00
[PR #595] [MERGED] refactor: cleanup path handling #1004
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/LGUG2Z/komorebi/pull/595
Author: @amrbashir
Created: 11/25/2023
Status: ✅ Merged
Merged: 11/27/2023
Merged by: @LGUG2Z
Base:
master← Head:refactor/cleanup-paths-handling📝 Commits (1)
3a4dcf1refactor: cleanup path handling📊 Changes
18 files changed (+305 additions, -530 deletions)
View changed files
📝
Cargo.lock(+9 -0)📝
Cargo.toml(+3 -0)📝
komorebi-core/Cargo.toml(+3 -1)📝
komorebi-core/src/custom_layout.rs(+11 -13)📝
komorebi-core/src/lib.rs(+35 -0)📝
komorebi/Cargo.toml(+2 -2)📝
komorebi/src/main.rs(+8 -28)📝
komorebi/src/monitor.rs(+2 -3)📝
komorebi/src/process_command.rs(+18 -38)📝
komorebi/src/process_movement.rs(+1 -1)📝
komorebi/src/static_config.rs(+4 -9)📝
komorebi/src/window.rs(+4 -4)📝
komorebi/src/window_manager.rs(+62 -75)📝
komorebi/src/windows_api.rs(+1 -1)📝
komorebi/src/winevent_listener.rs(+1 -1)📝
komorebi/src/workspace.rs(+2 -2)📝
komorebic/Cargo.toml(+3 -2)📝
komorebic/src/main.rs(+136 -350)📄 Description
I was just wandering around the codebase to get a bit familiar with it and it turned to a session of small refactors around paths handling.
This PR:
mut path & path.push()withpath.join()which is nicer and more concise and the cost is the same since it was already allocating when cloningduncecrate to removeUNCprefix~by avoiding unnecessary string allocations~,$Env:USERPROFILEand$HOMEconsistenly between different code pathsPathBufinstead ofStringfor paths in CLI argsI may have missed a couple of places but I think I covered 90% of path handling in the codebase
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.