]> git.cworth.org Git - rust-learning/commit
Switch from hello world to a program that prints a usage string
authorCarl Worth <cworth@cworth.org>
Tue, 10 Mar 2026 00:04:39 +0000 (17:04 -0700)
committerCarl Worth <cworth@cworth.org>
Thu, 12 Mar 2026 04:14:17 +0000 (21:14 -0700)
commitdda4d791f07485f7e71e3f2197abdba3cce5493c
treef11b3389cb5cb659685acdfab933830b0eb2e119
parentc51cd8d293415efa11a6e92ade6614099831d124
Switch from hello world to a program that prints a usage string

OK, so it's not much more than "hello, world", but it just show how to
use std::env as well as Vec<String> and even has an actual condition
in it! It's almost like real programming now.

Oh, and of course there's the collect() call which showcases both an
iterator and the magic of rust's type inference here (telling
collect() to return a Vec<string>). So, there's quite a bit of rust
here, even for just a tiny block of code.
src/main.rs