refactor: pass Unitig objects directly instead of raw byte slices

Refactored `try_for_each_unitig` and related pipelines across `obidebruinj` and `obikpartitionner` to accept `Unitig` instances directly. This eliminates manual `Unitig::from_nucleotides()` conversions, simplifies the data flow, and reduces unnecessary allocation overhead.
This commit is contained in:
Eric Coissac
2026-06-13 10:46:35 +02:00
parent 1f336fe496
commit fb8c6e427c
5 changed files with 14 additions and 16 deletions
+2 -2
View File
@@ -107,8 +107,8 @@ impl KmerPartition {
fs::create_dir_all(&layer_dir)?;
let mut uw = Layer::<()>::unitig_writer(&layer_dir).map_err(olm_to_sk)?;
g.try_for_each_unitig(|nucs| {
uw.write(&obikseq::unitig::Unitig::from_nucleotides(nucs))
g.try_for_each_unitig(|unitig| {
uw.write(unitig)
})?;
uw.close()?;
+2 -2
View File
@@ -307,8 +307,8 @@ impl KmerPartition {
g.compute_degrees_and_mark_starts();
fs::create_dir_all(&new_layer_dir)?;
let mut uw = Layer::<()>::unitig_writer(&new_layer_dir).map_err(olm_to_sk)?;
g.try_for_each_unitig(|nucs| {
uw.write(&obikseq::unitig::Unitig::from_nucleotides(nucs))
g.try_for_each_unitig(|unitig| {
uw.write(unitig)
})?;
uw.close()?;
let n = g.len();
+2 -2
View File
@@ -168,8 +168,8 @@ impl KmerPartition {
fs::create_dir_all(&dst_layer_dir)?;
let mut uw = Layer::<()>::unitig_writer(&dst_layer_dir).map_err(olm_to_sk)?;
g.try_for_each_unitig(|nucs| {
uw.write(&obikseq::unitig::Unitig::from_nucleotides(nucs))
g.try_for_each_unitig(|unitig| {
uw.write(unitig)
})?;
uw.close()?;
drop(g);