sample.rs 512 B

12345678910111213141516171819202122232425
  1. #![allow(unused)]
  2. const SRC: &str = include_str!("./samples/all.rsx");
  3. fn body() -> &'static str {
  4. &SRC[6..SRC.len() - 3]
  5. }
  6. fn unindented_body() -> String {
  7. body()
  8. .lines()
  9. .map(|line| match line.strip_prefix(" ") {
  10. Some(line) => line,
  11. None => line,
  12. })
  13. .collect::<Vec<_>>()
  14. .join("\n")
  15. }
  16. #[test]
  17. fn way_and_back() {
  18. let blocks = dioxus_autofmt::fmt_file(SRC).into_iter().next().unwrap();
  19. println!("{}", blocks.formatted);
  20. }