mirror of
https://github.com/nushell/nushell.git
synced 2025-05-28 14:07:08 +02:00
* Remove unnecessary `#[allow]` annots Reduce the number of lint exceptions that are not necessary with the current state of the code (or more recent toolchain) * Remove dead code from `FileStructure` in nu-command * Replace `allow(unused)` with relevant feature switch * Deal with `needless_collect` with annotations * Change hack for needless_collect in `from json` This change obviates the need for `allow(needless_collect)` Removes a pessimistic allocation for empty strings, but increases allocation size to `Value` Probably not really worth it. * Revert "Deal with `needless_collect` with annotations" This reverts commit 05aca984456438dc05b1fe89221c4305cb5d6472. The previous state seems to better from a performance perspective as a `Vec<String>` is lighter weight than `Vec<Value>`
nu-glob
Support for matching file paths against Unix shell style patterns.
Usage
To use nu-glob
, add this to your Cargo.toml
:
[dependencies]
nu-glob = "0.60.0"
Examples
Print all jpg files in /media/ and all of its subdirectories.
use nu_nu_glob::glob;
for entry in glob("/media/**/*.jpg").expect("Failed to read glob pattern") {
match entry {
Ok(path) => println!("{:?}", path.display()),
Err(e) => println!("{:?}", e),
}
}