October 2019
Intermediate to advanced
444 pages
10h 37m
English
This time, we are going to create two projects: one that offers some type of function and another one to use it. Therefore, use cargo to create both projects: cargo new rust-pilib --lib and cargo new pi-estimator. The second command creates a binary executable so we can run the compilation result, while the former is a library (crate).
This recipe is going to create a small program that prints out estimations of pi (
) and rounds them to two decimal places. It's nothing fancy and easy for anyone to understand.
Read now
Unlock full access