move to wrapper_ because it is cool and i want to use it

This commit is contained in:
lda committed 2025-01-12 06:52:26 +07:00
1 parent 6b24262927
commit 34bd99d3b4
3 files changed
+14 -10

No files matched your search

+1
View File
@@ -502,3 +502,4 @@ mod tests {
assert_eq!(aligned_str2, "test"); assert_eq!(aligned_str2, "test");
} }
} }
pub mod wrapper_;
+1 -10
View File
@@ -2,16 +2,7 @@ use std::fmt::Display;
use lda_strdist::*; use lda_strdist::*;
struct EditOperationVec<'e>(&'e Vec<EditOperation>); use wrapper_::EditOperationVec;
impl Display for EditOperationVec<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
for (i, op) in self.0.iter().enumerate() {
writeln!(f, "Step {}: {}", i + 1, op)?;
}
Ok(())
}
}
fn main() { fn main() {
let str1 = "AGTACGCA"; let str1 = "AGTACGCA";
+12
View File
@@ -0,0 +1,12 @@
use crate::EditOperation;
pub struct EditOperationVec<'e>(pub &'e Vec<EditOperation>);
impl std::fmt::Display for EditOperationVec<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
for (i, op) in self.0.iter().enumerate() {
writeln!(f, "Step {}: {}", i + 1, op)?;
}
Ok(())
}
}