Skip to content

Comments

Replace deprecated "filter" by "where" in registry.nu#119

Merged
cptpiepmatz merged 1 commit intonushell:mainfrom
Muttsuri:patch-1
Jun 12, 2025
Merged

Replace deprecated "filter" by "where" in registry.nu#119
cptpiepmatz merged 1 commit intonushell:mainfrom
Muttsuri:patch-1

Conversation

@Muttsuri
Copy link
Contributor

nushell deprecated filter in favour of where.
Should be drop in replacement.

Description

After recent update a nushell message:

Warning: nu::parser::deprecated

  × Command deprecated.
    ╭─[/home/muttsuri/.config/nushell/modules/nupm/utils/registry.nu:71:45]
 70 │             # Find all packages matching $package in the registry
 71 │             let pkg_files = $registry.reg | filter $name_matcher
    ·                                             ──────────┬─────────
    ·                                                       ╰── filter was deprecated in 0.105.0 and will be removed in a future release.
 72 │
    ╰────
  help: `where` command can be used instead, as it can now read the predicate closure from a variable

I think in the relevant file nupm already uses a closure to hold the condition, so as far as I can tell no further changes should be required.
Sorry if the PR is lackin in something I'm doing this mid work and I'm very green at this (first PR actually).

@cptpiepmatz
Copy link
Member

Yeah, that should be it, thanks!

@cptpiepmatz
Copy link
Member

Oh, the CI runs on an old version of nu

nushell deprecated filter in favour of where.
Should be drop in replacement.
@cptpiepmatz cptpiepmatz merged commit d9120b5 into nushell:main Jun 12, 2025
3 checks passed
@Muttsuri
Copy link
Contributor Author

Noob question, is it safe to drop my branch?

@fdncred
Copy link

fdncred commented Jun 12, 2025

yes

@Muttsuri Muttsuri deleted the patch-1 branch June 12, 2025 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants