Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 30, 2025

Clippy flagged unnecessary heap allocation when comparing PathBuf values in test assertions.

Changes

  • Replace path::PathBuf::from("/guest/workingdir/") with path::Path::new("/guest/workingdir/") in test

The get_working_directory() function returns PathBuf, which implements comparison with &Path. Creating a temporary PathBuf for comparison is redundant:

// Before
assert!(
    get_working_directory(&current_directory, &floki_root, &mount)
        == path::PathBuf::from("/guest/workingdir/")
)

// After
assert!(
    get_working_directory(&current_directory, &floki_root, &mount)
        == path::Path::new("/guest/workingdir/")
)
Original prompt

Please fix clippy warnings


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Fix clippy warnings in the codebase Fix clippy::cmp_owned warning in PathBuf comparison Oct 30, 2025
Copilot finished work on behalf of maxdymond October 30, 2025 19:47
Copilot AI requested a review from maxdymond October 30, 2025 19:47
@maxdymond maxdymond marked this pull request as ready for review October 31, 2025 09:19
@maxdymond maxdymond merged commit 21f6e49 into main Oct 31, 2025
15 checks passed
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