fix(adapters): zip-iterate reject_collisions, drop asserts (JS-03)
assert_eq! in library code was a panic-family residue in the import collision check (review 002 JS-03). The three vectors are built in lockstep by import(); zipping them preserves the pairwise walk without the panic path.
This commit is contained in:
@@ -71,8 +71,6 @@ fn reject_collisions(
|
|||||||
paths: Vec<String>,
|
paths: Vec<String>,
|
||||||
routes: Vec<(String, String)>,
|
routes: Vec<(String, String)>,
|
||||||
) -> Result<(), AdapterError> {
|
) -> Result<(), AdapterError> {
|
||||||
assert_eq!(op_ids.len(), routes.len());
|
|
||||||
assert_eq!(op_ids.len(), paths.len());
|
|
||||||
let mut seen_names: HashMap<&str, &str> = HashMap::new();
|
let mut seen_names: HashMap<&str, &str> = HashMap::new();
|
||||||
let mut seen_routes: HashMap<&(String, String), &str> = HashMap::new();
|
let mut seen_routes: HashMap<&(String, String), &str> = HashMap::new();
|
||||||
for ((op_id, path), route) in op_ids.iter().zip(paths.iter()).zip(routes.iter()) {
|
for ((op_id, path), route) in op_ids.iter().zip(paths.iter()).zip(routes.iter()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user