Skip to content

Commit 1a0f72f

Browse files
committed
style: fix CI for Tia
1 parent 453a948 commit 1a0f72f

File tree

3 files changed

+19
-11
lines changed

3 files changed

+19
-11
lines changed

crates/dimer-builder/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ edition = "2021"
55

66
[dependencies]
77
muropeptide = { path = "../muropeptide" }
8-
polars = "0.43.1"
8+
polars-core = "0.43.1"
9+
polars-lazy = "0.43.1"
910
polychem = { path = "../polychem" }
1011

1112
[lints]

crates/dimer-builder/src/lib.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
pub fn add(left: u64, right: u64) -> u64 {
1+
// NOTE: For Tia — you'll need to import Polars like this for it to compile to WebAssembly
2+
// https://www.reddit.com/r/rust/comments/yb58hk/how_to_use_polars_with_wasm/
3+
// That's because, by default, `polars` will import some code that interacts with the operating
4+
// system / terminal, and those APIs aren't available on the web!
5+
// use polars_core::prelude::*;
6+
// use polars_lazy::prelude::*;
7+
8+
#[must_use]
9+
pub const fn add(left: u64, right: u64) -> u64 {
210
left + right
311
}
412

crates/muropeptide/src/parser.rs

+8-9
Original file line numberDiff line numberDiff line change
@@ -129,19 +129,18 @@ pub fn muropeptide<'z, 'a, 'p, 's>(
129129
Ok(())
130130
};
131131
let crosslink = |descriptors| -> Result<(), ConstructionError> {
132+
fn lookup_amino_acid(
133+
peptide: &[AminoAcid],
134+
idx: u8,
135+
) -> Result<&AminoAcid, ConstructionError> {
136+
peptide
137+
.get(idx.saturating_sub(1) as usize)
138+
.ok_or(ConstructionError::NoStemResidue)
139+
}
132140
for &descriptor in descriptors {
133141
// FIXME: A nasty, very lazy hack:
134142
let mut lateral_acceptor = false;
135143
// FIXME: Are lateral chains ever donors?
136-
fn lookup_amino_acid(
137-
peptide: &[AminoAcid],
138-
idx: u8,
139-
) -> Result<&AminoAcid, ConstructionError>
140-
{
141-
peptide
142-
.get(idx.saturating_sub(1) as usize)
143-
.ok_or(ConstructionError::NoStemResidue)
144-
}
145144
let lookup_donor = |peptide, idx| {
146145
lookup_amino_acid(peptide, idx).map(|aa| aa.residue)
147146
};

0 commit comments

Comments
 (0)