Crates.io | dab |
lib.rs | dab |
version | 0.2.0 |
source | src |
created_at | 2022-01-25 13:28:14.119842 |
updated_at | 2022-06-06 11:36:12.592345 |
description | CLI tool for a Rustacean's everyday things |
homepage | |
repository | https://github.com/ohsayan/dab |
max_upload_size | |
id | 520775 |
size | 40,276 |
dab
: The pursuit of laziness for Rustaceans
dab
is a command-line tool that is intended for Rust developers to savor their much deserved laziness
after fighting with async
lifetimes or FFI. Right now, it does one very simple thing: create modules.
Well, I got a little mad creating modules while I was working on Skytable. Silly? Read this!
Simply run:
$ cargo install dab
dab modname
. This will create a src/modname/mod.rs
file along with
a module declaration (like mod modname
) in the "root file" which is either lib.rs
or main.rs
depending on your crate typedab -cskip --dskip --public mymod
: This will create a src/mymod.rs
file (note no directory creation), skip a license header in the "root file" (if any) and mark
the module visibility to be pub
syn
dab.toml
configuration that will be read for determining settingsrustfmt
on adding mod
entry to the root filecfg
attributesskyd::protocol
)cargo
does)Call it my personal itch, in large Rust projects I've been extremely annoyed while creating modules (especially in workspaces). The usual sequence was:
mkdir <package>/src/path/to/module
touch <package>/src/path/to/module/mod.rs
main.rs
or lib.rs
to add the package the nameI wanted to trim this down to one step. Hence, this tool.
This tool is licensed under the Apache-2.0 License.