فهرست منبع

clippy: make it happier

Jonathan Kelley 3 سال پیش
والد
کامیت
dc028df0dd
2فایلهای تغییر یافته به همراه1 افزوده شده و 10 حذف شده
  1. 1 1
      packages/router/src/components/link.rs
  2. 0 9
      packages/tui/tests/margin.rs

+ 1 - 1
packages/router/src/components/link.rs

@@ -106,7 +106,7 @@ pub fn Link<'a>(cx: Scope<'a, LinkProps<'a>>) -> Element {
                 Some(service) => service.cfg.active_class.clone(),
                 None => None,
             };
-            active_from_router.unwrap_or("active".into())
+            active_from_router.unwrap_or_else(|| "active".into())
         }
     };
 

+ 0 - 9
packages/tui/tests/margin.rs

@@ -23,7 +23,6 @@ fn margin_and_flex_row() {
                 size: stretch::geometry::Size {
                     width: stretch::style::Dimension::Points(100f32),
                     height: stretch::style::Dimension::Points(100f32),
-                    ..Default::default()
                 },
                 ..Default::default()
             },
@@ -76,7 +75,6 @@ fn margin_and_flex_row2() {
                 size: stretch::geometry::Size {
                     width: stretch::style::Dimension::Points(100f32),
                     height: stretch::style::Dimension::Points(100f32),
-                    ..Default::default()
                 },
                 ..Default::default()
             },
@@ -92,11 +90,4 @@ fn margin_and_flex_row2() {
     assert_eq!(stretch.layout(node).unwrap().size.height, 100f32);
     assert_eq!(stretch.layout(node).unwrap().location.x, 0f32);
     assert_eq!(stretch.layout(node).unwrap().location.y, 0f32);
-
-    dbg!(stretch.layout(node0));
-
-    // assert_eq!(stretch.layout(node0).unwrap().size.width, 80f32);
-    // assert_eq!(stretch.layout(node0).unwrap().size.height, 100f32);
-    // assert_eq!(stretch.layout(node0).unwrap().location.x, 10f32);
-    // assert_eq!(stretch.layout(node0).unwrap().location.y, 0f32);
 }