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;
7 pub use mapped::MappedLayer;7 pub use mapped::MappedLayer;
8 8
9 /// Rules fully resolved for a layer-shell surface.9 /// Rules fully resolved for a layer-shell surface.
10-#[derive(Debug, PartialEq)]10+#[derive(Debug, Default, PartialEq)]
11 pub struct ResolvedLayerRules {11 pub struct ResolvedLayerRules {
12 /// Extra opacity to draw this layer surface with.12 /// Extra opacity to draw this layer surface with.
13 pub opacity: Option<f32>,13 pub opacity: Option<f32>,
@@ -29,30 +29,10 @@ pub struct ResolvedLayerRules {
29 }29 }
30 30
31 impl ResolvedLayerRules {31 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-
52 pub fn compute(rules: &[LayerRule], surface: &LayerSurface, is_at_startup: bool) -> Self {32 pub fn compute(rules: &[LayerRule], surface: &LayerSurface, is_at_startup: bool) -> Self {
53 let _span = tracy_client::span!("ResolvedLayerRules::compute");33 let _span = tracy_client::span!("ResolvedLayerRules::compute");
54 34
55- let mut resolved = ResolvedLayerRules::empty();35+ let mut resolved = ResolvedLayerRules::default();
56 36
57 for rule in rules {37 for rule in rules {
58 let matches = |m: &Match| {38 let matches = |m: &Match| {