treewide: use lib.warnIf where appropriate

This commit is contained in:
Alyssa Ross
2021-04-28 21:44:21 +00:00
parent 81e1e68eaf
commit a8afbb45c1
6 changed files with 12 additions and 19 deletions
+2 -2
View File
@@ -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: