forge
Explore
Log in

Don't you dare go Hollow

Remove ResolvedLayerRules::empty()

Browse files at this commit

a78f07cd588fce2ac97294eb50228da09216d3bcIvan MolodetskikhParent: 765a241
Same cleanup as ResolvedWindowRules earlier, but here we didn't even
have any reason to keep having it.
src/layer/mod.rsmodified+2 -22
@@ -7,7 +7,7 @@ pub mod mapped;
77 pub use mapped::MappedLayer;
88
99 /// Rules fully resolved for a layer-shell surface.
10-#[derive(Debug, PartialEq)]
10+#[derive(Debug, Default, PartialEq)]
1111 pub struct ResolvedLayerRules {
1212 /// Extra opacity to draw this layer surface with.
1313 pub opacity: Option<f32>,
@@ -29,30 +29,10 @@ pub struct ResolvedLayerRules {
2929 }
3030
3131 impl ResolvedLayerRules {
32- pub const fn empty() -> Self {
33- Self {
34- opacity: None,
35- block_out_from: None,
36- shadow: ShadowRule {
37- off: false,
38- on: false,
39- offset: None,
40- softness: None,
41- spread: None,
42- draw_behind_window: None,
43- color: None,
44- inactive_color: None,
45- },
46- geometry_corner_radius: None,
47- place_within_backdrop: false,
48- baba_is_float: false,
49- }
50- }
51-
5232 pub fn compute(rules: &[LayerRule], surface: &LayerSurface, is_at_startup: bool) -> Self {
5333 let _span = tracy_client::span!("ResolvedLayerRules::compute");
5434
55- let mut resolved = ResolvedLayerRules::empty();
35+ let mut resolved = ResolvedLayerRules::default();
5636
5737 for rule in rules {
5838 let matches = |m: &Match| {