Commit cc4f14e8 authored by Dorota Czaplejewicz's avatar Dorota Czaplejewicz
Browse files

data: Flattened layout fallback function

parent 103e64b9
......@@ -128,41 +128,36 @@ fn list_layout_sources(
ret
};
let ret = {
fn name_with_arrangement(name: String, kind: &ArrangementKind)
-> String
{
match kind {
ArrangementKind::Base => name,
ArrangementKind::Wide => name + "_wide",
}
fn name_with_arrangement(name: String, kind: &ArrangementKind) -> String {
match kind {
ArrangementKind::Base => name,
ArrangementKind::Wide => name + "_wide",
}
}
let ret = Vec::new();
let ret = match &kind {
ArrangementKind::Base => ret,
kind => add_by_name(
ret,
&name_with_arrangement(name.into(), &kind),
&kind,
),
};
let ret = Vec::new();
let ret = add_by_name(ret, name, &ArrangementKind::Base);
let ret = match &kind {
ArrangementKind::Base => ret,
kind => add_by_name(
ret,
&name_with_arrangement(name.into(), &kind),
&kind,
),
};
let ret = match &kind {
ArrangementKind::Base => ret,
kind => add_by_name(
ret,
&name_with_arrangement(FALLBACK_LAYOUT_NAME.into(), &kind),
&kind,
),
};
let ret = add_by_name(ret, name, &ArrangementKind::Base);
add_by_name(ret, FALLBACK_LAYOUT_NAME, &ArrangementKind::Base)
let ret = match &kind {
ArrangementKind::Base => ret,
kind => add_by_name(
ret,
&name_with_arrangement(FALLBACK_LAYOUT_NAME.into(), &kind),
&kind,
),
};
ret
add_by_name(ret, FALLBACK_LAYOUT_NAME, &ArrangementKind::Base)
}
fn load_layout_data(source: DataSource)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment