Skip to content

rna-transcription: abbreviate to 'rna' and 'dna'#410

Merged
petertseng merged 4 commits intoexercism:masterfrom
shingtaklam1324:master
Dec 4, 2017
Merged

rna-transcription: abbreviate to 'rna' and 'dna'#410
petertseng merged 4 commits intoexercism:masterfrom
shingtaklam1324:master

Conversation

@shingtaklam1324
Copy link
Copy Markdown
Contributor

Also ran the example code and tests through rustfmt

Reference Issues
#407

Copy link
Copy Markdown
Member

@petertseng petertseng left a comment

Choose a reason for hiding this comment

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

Reference Issues

Please specifically use one of the words listed in https://help.github.com/articles/closing-issues-using-keywords/ so that the issue will be closed when this is merged.

Also ran the example code and tests through rustfmt

I would normally say this should be in its own commit and not merge this PR until that is done, but since most lines changed where also changed by the RNA/DNA change, it is mostly fine. I pointed out four lines where the change does not coincide with an RNA/DNA change.

The sources for what I say are:

Since in most cases it coincides, I won't argue if someone else decides it is OK to Approve and merge this. For Approval from me specifically, I need the rustfmt change to be in its own commit. Note that it is not necessary to have Approval from me specifically.

}

pub fn to_rna(&self) -> Result<RibonucleicAcid, ()> {
let rna_nucleotides: String = self.nucleotides.chars().filter_map(transcribe_dna_rna).collect();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

unrelated line change caused by fmt.

Comment thread exercises/rna-transcription/example.rs Outdated
'A' => Some('U'),
'T' => Some('A'),
_ => None
_ => None,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

unrelated line change caused by fmt.

Comment thread exercises/rna-transcription/example.rs Outdated
pub struct DeoxyribonucleicAcid {
nucleotides: String
pub struct DNA {
nucleotides: String,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

unrelated line change caused by fmt.

Comment thread exercises/rna-transcription/example.rs Outdated
pub struct RibonucleicAcid {
nucleotides: String
pub struct RNA {
nucleotides: String,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

unrelated line change caused by fmt.

@shingtaklam1324
Copy link
Copy Markdown
Contributor Author

Un-rustfmt-ed all of the code.

@petertseng petertseng changed the title Edited the 'rna-transcription' exercise to 'rna' and 'dna' rna-transcription: abbreviate to 'rna' and 'dna' Dec 4, 2017
Copy link
Copy Markdown
Member

@petertseng petertseng left a comment

Choose a reason for hiding this comment

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

As far as I can tell, this PR now contains only the rename to DNA and RNA. Since this approach gained acceptance in the issue proposing it, I think I'll merge it (I will squash the commits and edit the message to use one of the necessary words) after the tests pass.

@petertseng petertseng merged commit 70ecf1c into exercism:master Dec 4, 2017
@petertseng
Copy link
Copy Markdown
Member

Thank you. Feel free to submit a PR for rustfmt changes if you like. One commit that rustfmt all exercises is fine, I think. Note some specific lines we did not want to format in #143 though.

@shingtaklam1324
Copy link
Copy Markdown
Contributor Author

Thanks, given that none of the rest of the repository uses rustfmt, it makes sense to keep it so for consistency reasons. If I have some free time, I may write a bash script to handle cargo fmt-ing all of the code.

@shingtaklam1324
Copy link
Copy Markdown
Contributor Author

For #143 , rustfmt can have use the crate attribute #[cfg_attr(rustfmt, rustfmt_skip)] to skip the file. It just needs to be added to the crate root.

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