fix: temp dir warning - #1231
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a deprecation warning by updating the method used to get the path from a temporary directory object. The old into_path() method has been deprecated and replaced with path().
- Replace deprecated
into_path()calls withpath()method - Update two instances in the
install_from_urlfunction
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
I asked Claude about copilots review.. (😅) and it said this: Based on my analysis, the Copilot PR review is INCORRECT and misleading. Here's why: The Real IssueThe PR is trying to address a legitimate deprecation warning. I confirmed that Why the Review is Wrong
Correct SolutionThe PR author should use // For the rename case:
std::fs::rename(temp_dir.keep(), &target_path)?;
// For the error case, path() is actually fine:
std::fs::remove_dir_all(temp_dir.path())?;ConclusionThe Copilot review demonstrates a common issue with AI code reviewers - it identified a potential semantic difference but failed to consider:
The review should be rejected as it would reintroduce deprecated code rather than properly fixing the deprecation warning. |
|
Lol yeah both are wrong |
|
@IanButterworth you should set up https://github.com/upstash/context7 with your claude, so it can more easily query up-to-date docs |
|
Folded into #1232 |
Cherry picked from #1230
Old function is deprecated