summaryrefslogtreecommitdiffstats
path: root/rosalind/dna.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2013-03-13 22:50:02 -0500
committerJesse Luehrs <doy@tozt.net>2013-03-13 22:50:02 -0500
commita88eef55cd2552cb49d47c274ed080feac649112 (patch)
tree646d388d30745543ec79eb2a365b0f74fe129226 /rosalind/dna.rs
parent00e7efaee4bb250758563289ef509101b43715f1 (diff)
downloadrosalind-master.tar.gz
rosalind-master.zip
fixes for rust 0.6HEADmaster
Diffstat (limited to 'rosalind/dna.rs')
-rw-r--r--rosalind/dna.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/rosalind/dna.rs b/rosalind/dna.rs
index 7279c36..beb19a5 100644
--- a/rosalind/dna.rs
+++ b/rosalind/dna.rs
@@ -1,6 +1,6 @@
use str = core::str;
-pure fn gc_content(dna: &str) -> float {
+fn gc_content(dna: &str) -> float {
let mut content = 0;
for str::each_char(dna) |ch| {
match ch {
@@ -11,20 +11,20 @@ pure fn gc_content(dna: &str) -> float {
(content as float) / (str::len(dna) as float)
}
-pure fn complement(base: char) -> char {
+fn complement(base: char) -> char {
match base {
'A' => 'T',
'C' => 'G',
'G' => 'C',
'T' => 'A',
- _ => fail ~"Unknown character found",
+ _ => fail!(~"Unknown character found"),
}
}
-pure fn transcribe(base: char) -> char {
+fn transcribe(base: char) -> char {
match base {
'T' => 'U',
'A' | 'C' | 'G' => base,
- _ => fail ~"Unknown character found",
+ _ => fail!(~"Unknown character found"),
}
}