mirror of
https://github.com/nushell/nushell.git
synced 2024-12-23 15:39:06 +01:00
Update implementing_a_command.md (#3848)
+ nu-command/src/command.rs has been modified to nu-command/src/mod.rs in nowable version
This commit is contained in:
parent
e4c282f0a6
commit
ea42a84a4a
@ -86,7 +86,7 @@ pub struct Command;
|
||||
|
||||
Before registering it to the context you need to make it available by declaring the module and re-export it in `crates/nu-command/src/commands.rs`. The commands we write are modules already (`take_two.rs` is the `take_two` module). In case you are not familiar with rust modules [read this refresher](https://doc.rust-lang.org/book/ch07-02-defining-modules-to-control-scope-and-privacy.html). Let's go ahead and declare it and then re-export the command's `Command` struct as `TakeTwo`, like so:
|
||||
|
||||
_nu-command/src/commands.rs_
|
||||
_nu-command/src/mod.rs_
|
||||
```rust
|
||||
# ...
|
||||
pub(crate) mod take_two;
|
||||
|
Loading…
Reference in New Issue
Block a user