Skip to content

Commit

Permalink
Add "Rust CSV Cookbook" study
Browse files Browse the repository at this point in the history
  • Loading branch information
jolisper committed Jun 5, 2024
1 parent f132b83 commit 994fdb4
Show file tree
Hide file tree
Showing 6 changed files with 496 additions and 4 deletions.
4 changes: 4 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ members = [
"week-2/Lesson 1 - Rust Safety and Security Features/w2l1-lesson-reflections",
"week-2/Lesson 2 - Security Programming with Rust/rust-crypto_hashes",
"week-2/Lesson 2 - Security Programming with Rust/rust-software-security",
"week-2/Lesson 2 - Security Programming with Rust/decoder-ring", "week-2/Lesson 2 - Security Programming with Rust/w2l2-lesson-reflections", "week-2/Lesson 3 - Concurrency with Rust/concurrency-parallelism", "week-2/Lesson 3 - Concurrency with Rust/data-races-race-conditions", "week-2/Lesson 3 - Concurrency with Rust/send-sync", "week-2/Lesson 3 - Concurrency with Rust/atomics", "week-2/Lesson 3 - Concurrency with Rust/distributed-computing-concurrency", "week-2/Lesson 3 - Concurrency with Rust/challenges-opportunities-distributed", "week-2/Lesson 3 - Concurrency with Rust/dining-philosophers", "week-2/Lesson 3 - Concurrency with Rust/w2l3-lesson-reflections", "week-2/Lesson 3 - Concurrency with Rust/rayon-challenge", "week-3/Lesson 1 - Using Rust to Manage Data, Files and Network Storage/csv-writer",
"week-2/Lesson 2 - Security Programming with Rust/decoder-ring", "week-2/Lesson 2 - Security Programming with Rust/w2l2-lesson-reflections", "week-2/Lesson 3 - Concurrency with Rust/concurrency-parallelism", "week-2/Lesson 3 - Concurrency with Rust/data-races-race-conditions", "week-2/Lesson 3 - Concurrency with Rust/send-sync", "week-2/Lesson 3 - Concurrency with Rust/atomics", "week-2/Lesson 3 - Concurrency with Rust/distributed-computing-concurrency", "week-2/Lesson 3 - Concurrency with Rust/challenges-opportunities-distributed", "week-2/Lesson 3 - Concurrency with Rust/dining-philosophers", "week-2/Lesson 3 - Concurrency with Rust/w2l3-lesson-reflections", "week-2/Lesson 3 - Concurrency with Rust/rayon-challenge", "week-3/Lesson 1 - Using Rust to Manage Data, Files and Network Storage/csv-writer", "week-3/Lesson 1 - Using Rust to Manage Data, Files and Network Storage/csv-cookbook",
]
resolver = "2"
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
SHELL := /bin/bash
.PHONY: help all csv-writer
.PHONY: help all csv-writer csv-cookbook

help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

all: csv-writer ## Build all projects
all: csv-writer csv-cookbook ## Build all projects

csv-writer: ## Build csv-writer project
make -C "csv-writer" clean test build
make -C "csv-writer" clean test build

csv-cookbook: ## Build csv-cookbook project
make -C "csv-cookbook" clean test build
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[package]
name = "csv-cookbook"
version = "0.1.0"
edition = "2021"

[dependencies]
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
SHELL := /bin/bash
.PHONY: help clean lint format test doc build run bump

help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

clean: ## Remove all build artifacts
cargo clean

lint: ## Lint code
@rustup component add rustfmt 2> /dev/null
cargo clippy

format: ## Format code
@rustup component add rustfmt 2> /dev/null
cargo fmt

test: ## Run tests
cargo test

doc: ## Generate documentation
cargo doc --no-deps

bench: ## Run benchmarks
cargo bench

build: ## Build
cargo build

all: clean lint format test doc build ## Build and run

run: ## Run
cargo run

bump: ## Bump version
@echo "Current version: $$(cargo pkgid | grep -o '#.*' | cut -d# -f2)"
@read -p "Enter new version: " new_version && \
sed -i "s/version = \".*\"/version = \"$$new_version\"/" Cargo.toml && \
echo "Updated to new version: $$(cargo pkgid | grep -o '#.*' | cut -d# -f2)"
Loading

0 comments on commit 994fdb4

Please sign in to comment.