1pub mod analyze;
2pub mod cache;
3pub mod call_classification;
4pub mod call_target;
5pub mod checker;
6pub mod context;
7pub mod diagnostics;
8pub mod facts;
9pub mod loader;
10pub mod module_graph;
11pub mod passes;
12pub mod path;
13pub mod prelude;
14pub mod store;
15
16use syntax::ast::Expression;
17
18pub(crate) fn is_trivial_expression(expression: &Expression) -> bool {
19 match expression {
20 Expression::Unit { .. } => true,
21 Expression::Block { items, .. } => {
22 items.is_empty() || (items.len() == 1 && matches!(items[0], Expression::Unit { .. }))
23 }
24 Expression::Tuple { elements, .. } => elements.is_empty(),
25 _ => false,
26 }
27}