diff --git a/lib/credo/check/refactor/utc_now_truncate.ex b/lib/credo/check/refactor/utc_now_truncate.ex index d677ed4b0..1a7e0e045 100644 --- a/lib/credo/check/refactor/utc_now_truncate.ex +++ b/lib/credo/check/refactor/utc_now_truncate.ex @@ -6,15 +6,15 @@ defmodule Credo.Check.Refactor.UtcNowTruncate do check: """ `DateTime.utc_now/1` is more efficient than `DateTime.utc_now/0 |> DateTime.truncate/1`. - This should be refactored: + For example, the code here ... DateTime.utc_now() |> DateTime.truncate(:second) + NaiveDateTime.utc_now() |> NaiveDateTime.truncate(:second) - to look like this: + ... can be refactored to look like this: DateTime.utc_now(:second) - - Dito for `NaiveDateTime`. + NaiveDateTime.utc_now(:second) The reason for this is not just performance, because no separate function call is required, but also brevity of the resulting code.