Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the repository link extraction function to remove duplicate links using a HashSet.
- The LinkInfo struct is updated with Eq, PartialEq, and Hash derives.
- The extract_links_from_repo_url function now returns a HashSet instead of a Vec and uses HashSet::insert to add elements.
Comments suppressed due to low confidence (1)
src/git/mod.rs:19
- Changing the return type from Vec to HashSet removes element ordering; please ensure that consumers of this function do not rely on a specific order or update the documentation accordingly.
pub fn extract_links_from_repo_url(repo_url: &str) -> Result<HashSet<LinkInfo>, git2::Error> {
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
♟️ What’s this PR about?
HashMap을 사용해서 Repository에서 추출한 링크의 중복으 제거하였다.
테스트를 추가하지는 못했는데, 이유는 현재 git 모듈에 있는 함수가 repository 링크 받아서 클론 하고 파일에서 링크 추출하는 역할을 전부 수행하고 있어서, 즉 한 함수가 하고 있는 일이 많아서 테스트하기가 어렵다.
추후에 이 함수의 역할을 분리하여 테스트를 진행할 수 있도록 해야겠다.
🔗 Related Issues / PRs
part of #49