From d33127863ecda07ddd292d9bad7f8717f69430a0 Mon Sep 17 00:00:00 2001 From: Alois Wohlschlager Date: Sat, 3 Feb 2024 16:13:04 +0100 Subject: lib: make deprecation warnings consistent The deprecation warnings in lib were wildly inconsistent. Different formulations were used in different places for the same meaning. Some warnings used builtins.trace instead of lib.warn, which prevents silencing; one even only had a comment instead. Make everything more uniform. --- lib/attrsets.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib/attrsets.nix') diff --git a/lib/attrsets.nix b/lib/attrsets.nix index 99b6869184534..0e896a93156d5 100644 --- a/lib/attrsets.nix +++ b/lib/attrsets.nix @@ -3,7 +3,7 @@ let inherit (builtins) head tail length; - inherit (lib.trivial) id mergeAttrs; + inherit (lib.trivial) id mergeAttrs warn; inherit (lib.strings) concatStringsSep concatMapStringsSep escapeNixIdentifier sanitizeDerivationName; inherit (lib.lists) foldr foldl' concatMap concatLists elemAt all partition groupBy take foldl; in @@ -1197,9 +1197,10 @@ rec { (x // y) // mask; # DEPRECATED - zipWithNames = zipAttrsWithNames; + zipWithNames = warn + "lib.zipWithNames is a deprecated alias of lib.zipAttrsWithNames." zipAttrsWithNames; # DEPRECATED - zip = builtins.trace - "lib.zip is deprecated, use lib.zipAttrsWith instead" zipAttrsWith; + zip = warn + "lib.zip is a deprecated alias of lib.zipAttrsWith." zipAttrsWith; } -- cgit 1.4.1