cargo doc generates HTML documentation from your Rust code and doc comments. It's built into Cargo - no plugins or configuration needed.
# Generate documentation| .PHONY: help build test run fmt clippy check clean pre-commit-install all | |
| help: | |
| @echo "Available commands:" | |
| @echo " make build - Build the project" | |
| @echo " make test - Run tests" | |
| @echo " make run - Run the binary" | |
| @echo " make fmt - Format code" | |
| @echo " make fmt-check - Check formatting" | |
| @echo " make clippy - Run linter" |
| #[cfg(test)] | |
| mod tests { | |
| use super::*; | |
| #[test] | |
| fn test_empty_braces() { | |
| let tokens = tokenize("{}"); | |
| assert_eq!(tokens.len(), 2); | |
| assert_eq!(tokens[0], Token::LeftBrace); | |
| assert_eq!(tokens[1], Token::RightBrace); |
| repos: | |
| - repo: local | |
| hooks: | |
| - id: cargo-fmt | |
| name: cargo fmt | |
| entry: cargo fmt --manifest-path rust-json-parser/Cargo.toml -- | |
| language: system | |
| types: [rust] | |
| pass_filenames: false |