From 867aaf8a3491810a7b5bcf39e6eca4365ab9a0aa Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Mon, 2 Nov 2026 15:27:36 +0100 Subject: by-name.nix: Remove useless `warn` function Both cppnix and lix now have the `builtins.warn` function. --- by-name.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'by-name.nix') diff --git a/by-name.nix b/by-name.nix index 2d03e75..1b03712 100644 --- a/by-name.nix +++ b/by-name.nix @@ -7,7 +7,6 @@ # # You should have received a copy of the License along with this program. # If not, see . -{warn}: # Adapted from this: https://github.com/NixOS/nixpkgs/blob/1814b56453c91192f6d5a6276079948f9fe96c18/pkgs/top-level/by-name-overlay.nix # This file should not depend on `pkgs` and thus not use `lib`. { @@ -77,7 +76,7 @@ assert fileRegex == null -> fileName != null; let # Type: String -> String -> ListOf Path namesForShard = shard: type: if type != "directory" - then warn "Ignored non-directory, whilst importing by-name directory (${fileDisplay}): '${shard}'" {} + then builtins.warn "Ignored non-directory, whilst importing by-name directory (${fileDisplay}): '${shard}'" {} else if useShards then namesForElementShard shard type else namesForElementDirect shard type; @@ -102,14 +101,14 @@ assert fileRegex == null -> fileName != null; let else if relativePaths then pathSegment else path - else warn "'${builtins.toString path}' does not exist. Skipped" null; + else builtins.warn "'${builtins.toString path}' does not exist. Skipped" null; in if toplevelType != "directory" then # The `namesForShard` function should have already printed a warning. [null] else if (builtins.attrValues paths) == [] - then warn "'${fileDisplay}' did not match anything in ${builtins.toString rawPath}. Skipped" [null] + then builtins.warn "'${fileDisplay}' did not match anything in ${builtins.toString rawPath}. Skipped" [null] else mapAttrsToList checkPath paths; filterNull = list: builtins.filter (value: value != null) list; -- cgit v1.3.1