1
0

simple-combo-expr.wrong.rsx 914 B

1234567891011121314151617181920212223
  1. fn main() {
  2. rsx! {
  3. div {{
  4. let millis = timer.with(|t| t.duration().saturating_sub(t.started_at.map(|x| x.elapsed()).unwrap_or(Duration::ZERO)).as_millis());
  5. format!("{:02}:{:02}:{:02}.{:01}",
  6. millis / 1000 / 3600 % 3600,
  7. millis / 1000 / 60 % 60,
  8. millis / 1000 % 60,
  9. millis / 100 % 10)
  10. }}
  11. div {
  12. input { r#type: "number", min: 0, max: 99, value: format!("{:02}",timer.read().hours), oninput: move |e| {
  13. timer.write().hours = e.value().parse().unwrap_or(0);
  14. }
  15. }
  16. // some comment
  17. input { r#type: "number", min: 0, max: 99, value: format!("{:02}",timer.read().hours), oninput: move |e| {
  18. timer.write().hours = e.value().parse().unwrap_or(0);
  19. }
  20. }
  21. }
  22. }
  23. }