Crates.io | cargo-leet |
lib.rs | cargo-leet |
version | 0.2.0 |
source | src |
created_at | 2024-02-01 05:11:33.278729 |
updated_at | 2024-02-01 05:11:33.278729 |
description | Utility program to help with working on leetcode locally |
homepage | |
repository | https://github.com/rust-practice/cargo-leet |
max_upload_size | |
id | 1122660 |
size | 163,623 |
A program that given the link or slug to a leetcode problem, creates a local file where you can develop and test your solution before post it back to leetcode.
cargo leet
cargo leet generate --help
Using the library to "mimic" leetcode environment. Add library as a dependency as below. Then add use statements as necessary. The use statements are automatically added if tool is used to generate the file for the problem.
cargo-leet = { git = "https://github.com/rust-practice/cargo-leet.git", branch = "develop" }
NB: If cargo-leet is already installed you do the install it will just replace it even it it was previously installed from a different source. For example if you install it from a clone then run the command to install from git it will replace the existing version that is installed (they will not both be installed).
cargo install --git https://github.com/rust-practice/cargo-leet.git --branch main --features=tool
After cloning the repo run
cargo install --path . --features=tool
or using alias from .cargo/config.toml
cargo i
These commands allow you to run the tool directly from the source code without installation.
By default they will run the tool on the current working directory.
This means that it will run in the current project folder for cargo-leet.
This may be fine for testing but if you want to be able to actually run the code,
it might be more appropriate to pass the path parameter and specify the path to the repository you want to to run against.
Eg. cargo g --path $TEST_REPO
For more options see generate help
cargo run --features=tool -- leet gen
or using alias from .cargo/config.toml
cargo g
cargo uninstall cargo-leet
All code in this repository is dual-licensed under either:
at your option. This means you can select the license you prefer! This dual-licensing approach is the de-facto standard in the Rust ecosystem and there are very good reasons to include both as noted in this issue on Bevy's repo.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.