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

Feat/populate criteria #42

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open

Feat/populate criteria #42

wants to merge 3 commits into from

Conversation

enola-dkfz
Copy link
Member

No description provided.

Copy link
Member

@Threated Threated left a comment

Choose a reason for hiding this comment

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

Only some nits

src/catalogue.rs Outdated
Comment on lines 118 to 125
let group_key = if group_key == "patient" || group_key == "donor" {
"patients"
} else if group_key == "tumor_classification" {
"diagnosis"
} else if group_key == "biosamples" {
} else if group_key == "biosamples" || group_key == "sample" {
"specimen"
} else {
&group_key
Copy link
Member

Choose a reason for hiding this comment

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

This would look much nicer with a match

counts
.get(key1)
.and_then(|group| group.get(key2))
counts.get(key1).and_then(|group| group.get(key2))
Copy link
Member

Choose a reason for hiding this comment

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

I like and_then but when you return an Option you can also use ? and just chain the operations which is a bit nicer. If you decide to change it also do it for the get_element function

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