From bbab0538d2d0ddfdc0ef3f73e342c2d1f7222835 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 9 Jun 2015 12:27:47 +0200 Subject: [PATCH 1/1] add 'rawsrc' target to generate raw sources (without the course comments) --- .gitignore | 5 +++-- Makefile | 12 +++++++++--- src/part01.rs | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index bdde55a..aabea6f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ -target -docs +target/ +docs/ sync-docs +rawsrc/ diff --git a/Makefile b/Makefile index cb4172e..830ba37 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,11 @@ -all: docs -.PHONY: docs +FILES=$(wildcard src/*.rs) + +all: docs rawsrc +.PHONY: docs rawsrc docs: - docco src/*.rs -l linear + @docco $(FILES) -l linear + +rawsrc: + @mkdir -p rawsrc + @for file in $(FILES); do echo "$$file -> raw$$file"; egrep -v "^[[:space:]]*// " "$$file" > "raw""$$file"; done diff --git a/src/part01.rs b/src/part01.rs index 7c205bd..7d66385 100644 --- a/src/part01.rs +++ b/src/part01.rs @@ -77,7 +77,7 @@ impl NumberOrNothing { // is independent of the definition of the type. `self` is like `this` in other // languages, and its type is always implicit. So `print` is now a method that // takes as first argument a `NumberOrNothing`, just like `print_number_or_nothing`. -// +// // Try making `number_or_default` from above an inherent method as well! // With our refactored functions and methods, `main` now looks as follows: -- 2.30.2