From 81b16dfc16115b564fd780e1a23f0159425a2df2 Mon Sep 17 00:00:00 2001 From: Alexandre Hamez Date: Thu, 28 Nov 2024 11:53:08 +0100 Subject: [PATCH] chore: apply credo recommandations --- benchmarks/handmade_payloads.exs | 30 +++++++++++++++--------------- lib/protox/guards.ex | 4 ++-- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/benchmarks/handmade_payloads.exs b/benchmarks/handmade_payloads.exs index 705a7a75..4da5337e 100644 --- a/benchmarks/handmade_payloads.exs +++ b/benchmarks/handmade_payloads.exs @@ -39,7 +39,7 @@ defmodule Protox.Benchmarks.HandmadePayloads do a: 3342, b: "dqsqsdcqsqddqsqsd qsdqs dqsd ", c: -4_678_909_765, - d: 29232, + d: 29_232, e: 8_938_293, f: -242_424, bbb: <<1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15>>, @@ -63,7 +63,7 @@ defmodule Protox.Benchmarks.HandmadePayloads do g: [ 3, 270, - 86942, + 86_942, 13, 22, 3423, @@ -72,11 +72,11 @@ defmodule Protox.Benchmarks.HandmadePayloads do 12, 98, 142_442, - 14500, + 14_500, 0, 3, 270, - 86942, + 86_942, 13, 22, 3423, @@ -85,11 +85,11 @@ defmodule Protox.Benchmarks.HandmadePayloads do 12, 98, 142_442, - 14500, + 14_500, 0, 3, 270, - 86942, + 86_942, 13, 22, 3423, @@ -98,11 +98,11 @@ defmodule Protox.Benchmarks.HandmadePayloads do 12, 98, 142_442, - 14500, + 14_500, 0, 3, 270, - 86942, + 86_942, 13, 22, 3423, @@ -111,11 +111,11 @@ defmodule Protox.Benchmarks.HandmadePayloads do 12, 98, 142_442, - 14500, + 14_500, 0, 3, 270, - 86942, + 86_942, 13, 22, 3423, @@ -124,11 +124,11 @@ defmodule Protox.Benchmarks.HandmadePayloads do 12, 98, 142_442, - 14500, + 14_500, 0, 3, 270, - 86942, + 86_942, 13, 22, 3423, @@ -137,11 +137,11 @@ defmodule Protox.Benchmarks.HandmadePayloads do 12, 98, 142_442, - 14500, + 14_500, 0, 3, 270, - 86942, + 86_942, 13, 22, 3423, @@ -150,7 +150,7 @@ defmodule Protox.Benchmarks.HandmadePayloads do 12, 98, 142_442, - 14500, + 14_500, 0, 3 ] diff --git a/lib/protox/guards.ex b/lib/protox/guards.ex index 299a95c4..97db1535 100644 --- a/lib/protox/guards.ex +++ b/lib/protox/guards.ex @@ -4,8 +4,8 @@ defmodule Protox.Guards do @integers_fixed32 [:fixed32, :sfixed32] @integers_fixed64 [:fixed64, :sfixed64] - @primitives_fixed32 @integers_fixed32 ++ [:float] - @primitives_fixed64 @integers_fixed64 ++ [:double] + @primitives_fixed32 [:float | @integers_fixed32] + @primitives_fixed64 [:double | @integers_fixed64] @primitives_fixed @primitives_fixed32 ++ @primitives_fixed64 @primitives_varint32 [:int32, :uint32, :sint32]