From a8afbb45c12be27b9b93a802e9e276595899ed5a Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Tue, 27 Apr 2021 13:52:15 +0000 Subject: treewide: use lib.warnIf where appropriate --- lib/strings.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/strings.nix') diff --git a/lib/strings.nix b/lib/strings.nix index 5010d9159cb..0f23b6b9d41 100644 --- a/lib/strings.nix +++ b/lib/strings.nix @@ -644,8 +644,8 @@ rec { floatToString = float: let result = toString float; precise = float == fromJSON result; - in if precise then result - else lib.warn "Imprecise conversion from float to string ${result}" result; + in lib.warnIf (!precise) "Imprecise conversion from float to string ${result}" + result; /* Check whether a value can be coerced to a string */ isCoercibleToString = x: -- cgit 1.4.1