Skip to content

Commit

Permalink
fix: added CI updates to pass build
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanholz committed Jan 26, 2024
1 parent 7250780 commit 565e2f7
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ pub mod records;
use records::Record;

#[cfg(feature = "parallel")]
pub fn pdbreader(contents: &String) -> Vec<Record> {
pub fn pdbreader(contents: &str) -> Vec<Record> {
use rayon::prelude::*;

let lines: Vec<&str> = contents.lines().collect();
Expand Down Expand Up @@ -34,7 +34,7 @@ pub fn pdbreader(contents: &String) -> Vec<Record> {
record
}

pub fn pdbreader_single(contents: &String) -> Vec<Record> {
pub fn pdbreader_single(contents: &str) -> Vec<Record> {
let mut last = 0;
contents
.lines()
Expand Down
9 changes: 5 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ fn main() {
// println!("{:?}", out[0]);
out.iter()
// .filter(|&record| matches!(record, records::Record::DBRef(_)))
.filter(|&record| match record {
records::Record::DBRef(_) => true,
records::Record::Seqres(_) => true,
_ => false,
.filter(|&record| {
matches!(
record,
records::Record::Seqres(_) | records::Record::DBRef(_)
)
})
// .skip(99996)
// .take(10)
Expand Down
2 changes: 1 addition & 1 deletion src/records/atom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl AtomRecord {
element: str
.get(77..80)
.map(|str| str.trim().to_string())
.filter(|item| item != ""),
.filter(|item| !item.is_empty()),
charge: str
.get(78..80)
.map(|str| str.trim().to_string())
Expand Down
8 changes: 4 additions & 4 deletions src/records/mtrixn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ mod tests {
assert_eq!(record.serial_number, 1);
assert_eq!(record.matrix, [-1., 0., 0.]);
assert_eq!(record.vn, 0.);
assert_eq!(record.i_given, true);
assert!(record.i_given);
let line2 = "MTRIX2 1 0.000000 1.000000 0.000000 0.00000 1";
let record = MtrixnRecord::from(line2);

assert_eq!(record.n, 2);
assert_eq!(record.serial_number, 1);
assert_eq!(record.matrix, [0., 1., 0.]);
assert_eq!(record.vn, 0.);
assert_eq!(record.i_given, true);
assert!(record.i_given);
}

#[test]
Expand All @@ -112,9 +112,9 @@ mod tests {
assert_eq!(record.serial_number, 1);
assert_eq!(record.matrix, [-1., 0., 0.]);
assert_eq!(record.vn, 0.);
assert_eq!(record.i_given, true);
assert!(record.i_given);
}
_ => assert!(false),
_ => unreachable!(),
}
}

Expand Down
1 change: 0 additions & 1 deletion src/records/seqres.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ impl SeqresRecord {
chain_id: str.chars().nth(11).unwrap(),
num_res: str[13..17].trim().parse().unwrap(),
res_names: str[19..]
.trim()
.split_whitespace()
.map(|s| s.to_string())
.collect(),
Expand Down

0 comments on commit 565e2f7

Please sign in to comment.