Compare commits

..
1 Commits
3 changed files with 15 additions and 11 deletions

No files matched your search

+2 -1
View File
@@ -54,7 +54,7 @@ impl CustomCost for EditCost {
} }
} }
/// is this the main struct /// is this the main struct
/// ///
/// cost of operation and the operation itself /// cost of operation and the operation itself
#[derive(Debug, Clone, Copy, PartialEq)] #[derive(Debug, Clone, Copy, PartialEq)]
pub struct CostOperation { pub struct CostOperation {
@@ -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(())
}
}