1. 30 Jun, 2020 3 commits
  2. 29 Jun, 2020 8 commits
  3. 24 Jun, 2020 2 commits
  4. 23 Jun, 2020 20 commits
    • Günther Wagner's avatar
      Slipped warnings fixed · 57911044
      Günther Wagner authored
      Some warnings got reapplied and happened in the other merge request.
      Fixed these along with this commit.
      57911044
    • Günther Wagner's avatar
      Remove unnecessary variables · 2573b046
      Günther Wagner authored
      Unnecessary clones got removed in an earlier commit. This change
      orphaned some variables which aren't needed anymore.
      2573b046
    • Günther Wagner's avatar
      Unnecessary explicit lifetime and reference-dereferencing · 45fdfc45
      Günther Wagner authored
      this pattern takes a reference on something that is being de-referenced
      let attr = attrs.iter().find(|&ref x| x.0 == "identity");
      help: try removing the `&ref` part and just keep: `x`
      
      explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
      45fdfc45
    • Günther Wagner's avatar
      Some smaller ergonomic changes · 6f871b7c
      Günther Wagner authored
      in an `if` condition, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let`
      writing `&String` instead of `&str` involves a new object where a slice will do. (function parameter)
      this `.into_iter()` call is equivalent to `.iter()` and will not move the `slice`
      writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices.
      6f871b7c
    • Günther Wagner's avatar
      collapse nested if/else blocks · 21f59ec5
      Günther Wagner authored
      warning: this `else { if .. }` block can be collapsed
      21f59ec5
    • Günther Wagner's avatar
      destructuring single pattern · 3d217ac8
      Günther Wagner authored
      If destructuring a pattern and only using one match then its better to use
      if let statements to avoid the rest-match arm.
      3d217ac8
    • Günther Wagner's avatar
      Various smaller ones · 2813ef43
      Günther Wagner authored
      You are using an explicit closure for copying elements
      You are using an explicit closure for cloning elements
      you don't need to add `&` to both the expression and the patterns
      you don't need to add `&` to all patterns
      use of a blacklisted/placeholder name `bar`/`foo`
      manual implementation of an assign operation
      `ref` directly on a function argument is ignored. Consider using a reference type instead.
      called `filter(p).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(p)` instead.
      single-character string constant used as pattern
      this creates an owned instance just for comparison ("image/gif".to_string())
      Matching on `Some` with `ok()` is redundant
      useless use of `format!`
      redundant closure found ( map(|foo| String::from(foo)) )
      long literal lacking separators (1_000_000_000)
      2813ef43
    • Günther Wagner's avatar
      changed or-functions · f1efe6c0
      Günther Wagner authored
      Instead of always calling the alternative function do it only when it resolves to true via a closure.
      f1efe6c0
    • Günther Wagner's avatar
      Simplify map-chains for GStrings · 8c080fb6
      Günther Wagner authored
      warning: called `map_or(None, f)` on an `Option` value. This can be done more directly by calling `and_then(f)` instead
      warning: warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)`
      8c080fb6
    • Günther Wagner's avatar
      fix option maps with a unit closure · 5b9a52c6
      Günther Wagner authored
      warning: called `map(f)` on an `Option` value where `f` is a unit closure
      This is about readability - its more clearly in an if let statement
      5b9a52c6
    • Günther Wagner's avatar
      Redundant field names in struct initialization · 47acdf7c
      Günther Wagner authored
      If variable name is exact the field name you can omit the redundant foo: foo.
      47acdf7c
    • Günther Wagner's avatar
      Removed clone from copyable types and static lifetime · efbf5849
      Günther Wagner authored
      Cloning copyable types is not necessary as the type is designed to be copied
      Statics always have by default a 'static lifetime therefore its not necessary
      efbf5849
    • Günther Wagner's avatar
      fixed strict comparison of f64 · e2de4141
      Günther Wagner authored
      this is an interesting error as it helps to fix floating point errors
      Comparing 2 f64 values should always be done with greater an value or lower an value as
      the implementation of floating point values are probably never exact a specific value.
      Note: This are errors for clippy - not warnings
      
      This is what clippy says for that:
      error: strict comparison of `f32` or `f64`
         --> fractal-gtk/src/widgets/scroll_widget.rs:315:38
          |
      315 |                 if now < end_time && adj.get_value().round() != end.round() {
          |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider comparing them within some error: `(adj.get_value().round() - end.round()).abs() > error`
          |
      note: `std::f32::EPSILON` and `std::f64::EPSILON` are available.
         --> fractal-gtk/src/widgets/scroll_widget.rs:315:38
          |
      315 |                 if now < end_time && adj.get_value().round() != end.round() {
          |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_cmp
      e2de4141
    • Günther Wagner's avatar
      Redudant pattern matching removed · 635eaf52
      Günther Wagner authored
      If the value of a destructured Result/Option is not used then it is more concise
      to use the is_* form for the if statement (is_err/is_none/is_ok/is_some)
      635eaf52
    • Günther Wagner's avatar
      Unnecessary 'return' removed · bf2c6db1
      Günther Wagner authored
      This removes let return statements and 'return' whenever it is not needed as
      it is possible to omit it.
      bf2c6db1
    • Günther Wagner's avatar
      Remove identical conversions · eda29276
      Günther Wagner authored
      Objects which are already the correct type dont need a conversion.
      This clutters the codebase which is not needed here.
      eda29276
    • Günther Wagner's avatar
      Removed redundant imports · 1c8be40e
      Günther Wagner authored
      Imports are only necessary if a specific symbol gets imported. Importing a crate without symbols
      is redundant as you have to use the crate name also in the first usage.
      1c8be40e
    • Günther Wagner's avatar
      Length comparison to zero · ade2f8cb
      Günther Wagner authored
      Explicit comparison with value.is_empty() instead of value == 0 is more readable
      and preferable
      ade2f8cb
    • Günther Wagner's avatar
      Remove redundant clones · a3a6c6ea
      Günther Wagner authored
      If an object gets dropped after a clone without any usage then clippy can
      recognize this. Removed these to lower the memory stress.
      a3a6c6ea
    • Alejandro Domínguez's avatar
  5. 22 Jun, 2020 6 commits
  6. 21 Jun, 2020 1 commit