1. 15 Nov, 2019 1 commit
  2. 25 Oct, 2019 2 commits
    • AdminXVII's avatar
    • AdminXVII's avatar
      Apply clippy lints and refactor loops for easier understanding · 10dd15d8
      AdminXVII authored
      - Use clippy to improve the code's clarity and efficiency.
      - Refactor loops
      
      Try to avoid `loop`s with `break`s when it can be replaced with
      while/for loops.
      
      One of the most encountered loop style is:
      ```rust
      if ecm.entity_store().children[&entity].len() > 0 {
        let mut index = 0;
      
        loop {
          let child = ecm.entity_store().children[&entity][index];
          // ...
      
          if index + 1 < ecm.entity_store().children[&entity].len() {
              index += 1;
          } else {
              break;
          }
        }
      }
      ```
      The check can be without any impact be done at the loop start:
      ```rust
      if ecm.entity_store().children[&entity].len() > 0 {
        let mut index = 0;
      
        while index < ecm.entity_store().children[&entity].len() {
          let child = ecm.entity_store().children[&entity][index];
          // ...
      
          index += 1;
        }
      }
      ```
      Then the if is redundant:
      ```rust
      let mut index = 0;
      
      while index < ecm.entity_store().children[&entity].len() {
        let child = ecm.entity_store().children[&entity][index];
        // ...
      
        index += 1;
      }
      ```
      and given that no children is added inside the loop, this is equivalent
      to
      ```rust
      for index in 0..ecm.entity_store().children[&entity].len() {
        let child = ecm.entity_store().children[&entity][index];
        // ...
      }
      ```
      10dd15d8
  3. 09 Oct, 2019 1 commit
  4. 07 Oct, 2019 1 commit
  5. 29 Jul, 2019 1 commit
  6. 17 Jun, 2019 1 commit
  7. 04 Jun, 2019 1 commit
  8. 29 May, 2019 1 commit
  9. 27 May, 2019 1 commit
  10. 15 May, 2019 2 commits
  11. 14 May, 2019 4 commits
  12. 16 Apr, 2019 2 commits