Skip to content

Commit

Permalink
stdlib: make helper modules available in std (#8841)
Browse files Browse the repository at this point in the history
> **Note**
> waiting for the following to land
> - #8824 to avoid conflicts,
i'll add this to `CONTRIBUTING.md` once it's ready 👍

should close #8839 

# Description
this PR moves the `log` submodule of `std` to the top of the call stack,
making it available in the rest of the library as `log`.
i've added some comments around the `submodules` list in
`load_standard_library` to make it clear how it should work.
 
# User-Facing Changes
`log` and `assert` are now available in the rest of `std`.

# Tests + Formatting
- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- ⚫ `toolkit test`
- 🟢 `toolkit test stdlib`

# After Submitting
```
$nothing
```
  • Loading branch information
amtoine committed Apr 10, 2023
1 parent de76c7a commit 6d51e34
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crates/nu-std/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,16 @@ pub fn load_standard_library(
let name = "std".to_string();
let content = include_str!("../lib/mod.nu");

// these modules are loaded in the order they appear in this list
#[rustfmt::skip]
let submodules = vec![
// helper modules that could be used in other parts of the library
("log", include_str!("../lib/log.nu")),
("assert", include_str!("../lib/assert.nu")),

// the rest of the library
("dirs", include_str!("../lib/dirs.nu")),
("help", include_str!("../lib/help.nu")),
("log", include_str!("../lib/log.nu")),
("xml", include_str!("../lib/xml.nu")),
];

Expand Down

0 comments on commit 6d51e34

Please sign in to comment.