Skip to content
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

Gh 784 review three head #513

Open
wants to merge 10 commits into
base: GH-784-review-three-base
Choose a base branch
from

Conversation

czarte
Copy link
Collaborator

@czarte czarte commented Sep 17, 2024

No description provided.

ip_country/src/country_block_serde.rs Show resolved Hide resolved
ip_country/src/country_block_serde.rs Show resolved Hide resolved
ip_country/src/country_block_serde.rs Show resolved Hide resolved
ip_country/src/country_block_serde.rs Show resolved Hide resolved
ip_country/src/country_finder.rs Show resolved Hide resolved
ip_country/src/country_finder.rs Show resolved Hide resolved
ip_country/src/country_finder.rs Show resolved Hide resolved
ip_country/src/country_finder.rs Show resolved Hide resolved
ipv4: Vec<CountryBlock>,
ipv6: Vec<CountryBlock>,
pub ipv4: Vec<CountryBlock>,
pub ipv6: Vec<CountryBlock>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The need for this public visibility surprises me a little... can you assure yourself that taking it out would truly break anything somewhere else?

Feels like if this was required it could be pointing to a wrong design (exposing the guts while nobody outside probably really need to know the details.)

pub fn get_node_location(ip_opt: Option<IpAddr>) -> Option<NodeLocation> {
pub fn get_node_location(
ip_opt: Option<IpAddr>,
country_code_finder: &CountryCodeFinder,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure where you needed to pull this variable out through the function's interface. As far as I remember you only supply &COUNTRY_CODE_FINDER at all those places. It makes a question if it should be inline or not. I'll leave the decision for you as you understand better the code and you might remember also usages (I assume it'd have been in a test) with a reference to a CountryCodeFinder. The problem is I cannot even imagine where you could and why would you get down to constructing a special CountryCodeFinder of somehow different qualities than what the central, official one offers.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, this could go back to use only COUNTRY_CODE_FINDER, because we use everywhere only real data

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