Osspial / derin

A Derive-Based GUI Library for Rust
Mozilla Public License 2.0
19 stars 2 forks source link

Fails to compile #16

Open micwoj92 opened 2 years ago

micwoj92 commented 2 years ago

when doing cargo build --release it spits out lots of warnings and couple errors, only listing errors here rustc 1.64.0-nightly (1517f5de0 2022-07-07) cargo 1.64.0-nightly (c0bbd42ce 2022-07-03)


error[E0308]: mismatched types
  --> derin_core/src/offset_widget.rs:68:40
   |
67 |     pub fn rect_clipped(&self) -> Option<BoundBox<D2, i32>> {
   |                                   ------------------------- expected `Option<_>` because of return type
68 |         self.clip.and_then(|clip_rect| clip_rect.intersect_rect(self.rect()))
   |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `Option`, found enum `cgmath_geometry::rect::Intersection`
   |
   = note: expected enum `Option<_>`
              found enum `cgmath_geometry::rect::Intersection<BoundBox<D2, i32>>`
help: try wrapping the expression in `Some`
   |
68 |         self.clip.and_then(|clip_rect| Some(clip_rect.intersect_rect(self.rect())))
   |                                        +++++                                     +

error[E0308]: mismatched types
   --> derin_core/src/widget_traverser/widget_stack.rs:204:60
    |
204 |                 let top_clip = self.clip_rect.and_then(|r| r.intersect_rect(top_rect));
    |                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `Option`, found enum `cgmath_geometry::rect::Intersection`
    |
    = note: expected enum `Option<_>`
               found enum `cgmath_geometry::rect::Intersection<BoundBox<D2, i32>>`
help: try wrapping the expression in `Some`
    |
204 |                 let top_clip = self.clip_rect.and_then(|r| Some(r.intersect_rect(top_rect)));
    |                                                            +++++                          +

error[E0308]: mismatched types
   --> derin_core/src/widget_traverser/widget_stack.rs:256:64
    |
256 |                     let top_clip = self.clip_rect.and_then(|r| r.intersect_rect(top_rect));
    |                                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `Option`, found enum `cgmath_geometry::rect::Intersection`
    |
    = note: expected enum `Option<_>`
               found enum `cgmath_geometry::rect::Intersection<BoundBox<D2, i32>>`
help: try wrapping the expression in `Some`
    |
256 |                     let top_clip = self.clip_rect.and_then(|r| Some(r.intersect_rect(top_rect)));
    |                                                                +++++                          +

For more information about this error, try `rustc --explain E0308`.