Skip to content

Instantly share code, notes, and snippets.

View 13hulk's full-sized avatar

Vikas Z 13hulk

View GitHub Profile
@13hulk
13hulk / cargo-doc.md
Created February 4, 2026 11:43
Pybites Rust Cohort: Cargo doc

Cargo Doc - Rust's Built-in Documentation Generator

What is cargo doc?

cargo doc generates HTML documentation from your Rust code and doc comments. It's built into Cargo - no plugins or configuration needed.

Basic Usage

# Generate documentation
@13hulk
13hulk / Makefile
Last active February 4, 2026 11:55
Pybites Rust Cohort: A minimal Makefile
.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"
@13hulk
13hulk / test-tokenizer.rs
Last active January 29, 2026 10:57
Pybites Rust Cohort: Tests for JSON tokenizer - Week 1
#[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);
@13hulk
13hulk / .pre-commit-config.yaml
Last active February 4, 2026 11:54
Pybites Rust Cohort: A minimal pre-commit hook
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