Open
Description
I suspect this is wrong now....
/// Connect the `from_io` to the `to_io` if they are compatible
pub fn connect(&mut self, from_io: IO, to_io: IO, level: usize) -> Result<()> {
// are we selecting from a sub-route of an IO, such as an array index or element of output object?
let from_io_subroute = self.from.strip_prefix(from_io.route() as &str).unwrap_or("");
if Self::compatible_types(from_io.datatypes(), to_io.datatypes(), &Route::from(from_io_subroute)) {
debug!(
"Connection built from '{}' to '{}'",
from_io.route(),
to_io.route()
);
self.from_io = from_io;
self.to_io = to_io;
self.level = level;
return Ok(());
}
bail!("Incompatible source and destination:\nSource '{}' of type {:#?}\nDestination '{} of type {:#?}\nfrom_io_subroute = {}",
from_io.route(), from_io.datatypes(),
to_io.route(), to_io.datatypes(), from_io_subroute)
}
It might work when an array, but probably not when sub-selecting a part of an outputs structure