Skip to content

Commit b79856a

Browse files
committedJul 28, 2022
Fix links reordering
1 parent 927d937 commit b79856a

File tree

3 files changed

+1
-14
lines changed

3 files changed

+1
-14
lines changed
 

‎src/formats/json.rs

-11
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ where
6666
} else {
6767
Ok(TaxRank::Unspecified)
6868
}
69-
7069
}
7170

7271
fn serialize_tax_rank<S>(x: &TaxRank, s: S) -> Result<S::Ok, S::Error>
@@ -191,17 +190,7 @@ fn load_node_link_json(tax_json: &Value) -> TaxonomyResult<GeneralTaxonomy> {
191190
// content
192191
let fixed_source = idx_mapping_after_sorting[&link.source];
193192
let fixed_target = idx_mapping_after_sorting[&link.target];
194-
195193
parent_ids[fixed_source] = fixed_target;
196-
// parent should always be higher than child in the tree and since we might
197-
// have moved things around we need to ensure it stays the case
198-
if fixed_target > fixed_source {
199-
parent_ids[fixed_target] = fixed_source;
200-
} else {
201-
parent_ids[fixed_source] = fixed_target;
202-
}
203-
parent_ids[idx_mapping_after_sorting[&link.source]] =
204-
idx_mapping_after_sorting[&link.target];
205194
}
206195

207196
GeneralTaxonomy::from_arrays(

‎src/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ mod taxonomy;
1111

1212
pub use crate::taxonomy::Taxonomy;
1313
pub use base::GeneralTaxonomy;
14+
pub use errors::{Error, ErrorKind};
1415
pub use formats::json;
1516
pub use formats::ncbi;
1617
pub use formats::newick;
1718
pub use formats::phyloxml;
1819
pub use rank::TaxRank;
19-
pub use errors::{Error, ErrorKind};
20-

‎src/taxonomy.rs

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ pub trait Taxonomy<'t> {
1717
/// This method must return the node itself as the first entry in the list
1818
/// and the root node as the last entry in the list.
1919
fn lineage(&'t self, tax_id: &'t str) -> TaxonomyResult<Vec<&'t str>> {
20-
// make a vec of parents of id1
2120
let mut parents = Vec::new();
2221
let mut last_parent = tax_id;
2322
parents.push(tax_id);

0 commit comments

Comments
 (0)
Please sign in to comment.