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

Implement CrateScope struct #5569

Merged
merged 3 commits into from Dec 1, 2022
Merged

Implement CrateScope struct #5569

merged 3 commits into from Dec 1, 2022

Conversation

Turbo87
Copy link
Member

@Turbo87 Turbo87 commented Dec 1, 2022

Similar to #5568, this PR implements a CrateScope struct, which we use for the crate_scopes column of the API tokens database table. It also includes a matches() method to verify whether it matches a crate name or not.

Related:

@Turbo87 Turbo87 added C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear A-backend ⚙️ labels Dec 1, 2022
}

pub fn matches(&self, crate_name: &str) -> bool {
let canonicalize = |name: &str| name.replace('-', "_");
Copy link
Member Author

Choose a reason for hiding this comment

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

for further discussion: do we want this canonicalization? or do we want the users to be precise?

@Turbo87
Copy link
Member Author

Turbo87 commented Dec 1, 2022

this feature is experimental. so while there is still an open question, we can adjust that later and still merge the PR for now.

@Turbo87 Turbo87 merged commit 652c12b into rust-lang:master Dec 1, 2022
@Turbo87 Turbo87 deleted the crate-scope branch December 1, 2022 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-backend ⚙️ C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant