Do something wrong instead of crashing for partitions pointing at files

This commit is contained in:
Lucien Greathouse
2018-06-10 23:22:07 -07:00
parent 9aa27f4c11
commit 9733f059c2

View File

@@ -32,8 +32,7 @@ fn file_to_instances(
// This is placeholder logic; this whole function is!
let (class_name, property_key, name) = {
// TODO: Root instances have an empty route
let file_name = route.route.last().unwrap();
let file_name = route.route.last().unwrap_or(&route.partition);
fn strip_suffix<'a>(source: &'a str, suffix: &'static str) -> &'a str {
&source[..source.len() - suffix.len()]