-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
fix(core): dedupe project files in rust #17618
fix(core): dedupe project files in rust #17618
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
268ad29
to
b93e5de
Compare
c268339
to
78d7b4e
Compare
} | ||
(projects, file_hashes) | ||
}); | ||
Ok((projects, file_data)) | ||
Ok(( | ||
projects.into_iter().map(|(_, config)| config).collect(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a clippy suggestion for this:
projects.into_iter().map(|(_, config)| config).collect(), | |
projects.into_values().collect(), |
globs: &GlobSet, | ||
) { | ||
if globs.is_match(&path) { | ||
let parent = path.parent().unwrap_or(Path::new("")).to_path_buf(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use unwrap_or_else
so that it's lazily evaluated.
let parent = path.parent().unwrap_or(Path::new("")).to_path_buf(); | |
let parent = path.parent().unwrap_or_else(|| Path::new("")).to_path_buf(); |
if !existing_project | ||
|| (existing_project |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a clippy warning too. We can remove the second existing_project
check, because we already know it exists in this branch
} else { | ||
if !config_paths.contains_key(&parent) { | ||
config_paths.insert(parent, (path, content)); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clippy:
} else { | |
if !config_paths.contains_key(&parent) { | |
config_paths.insert(parent, (path, content)); | |
} | |
} | |
} else { | |
config_paths.entry(parent).or_insert((path, content)); | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a bunch of clippy suggestions that should be fixed
78d7b4e
to
4435464
Compare
4435464
to
4c7e33c
Compare
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Current Behavior
When getting config files via rust, config files were not deduped.
Expected Behavior
Getting config files via rust, config files are deduped properly.
Related Issue(s)
Fixes #