Skip to content

Instantly share code, notes, and snippets.

View BobGneu's full-sized avatar
🤖

Bob Chatman BobGneu

🤖
View GitHub Profile
//! ## Documentation Example
//!
//! This is a lot of great documentation, you ought to read and maintain this.
//!
//! Somehow i think, you are going to not do that.
//!
//! ```rust
//! use documentation_test::meaning_of_life;
//!
//! fn it_works() {
> cargo test
Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
Running target\debug\deps\documentation_test-4cd8ffe7876c6af7.exe
running 1 test
test tests::it_works ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
Doc-tests documentation_test
@BobGneu
BobGneu / Rust Documentation - 2 weeks l;ater
Created March 21, 2018 17:13
Rust Documentation Article Code Example 2
//! ## Documentation Example
//!
//! This is a lot of great documentation, you ought to read and maintain this.
//!
//! Somehow i think, you are going to not do that.
//!
//! ```rust
//! fn it_works() {
//! assert_eq!(2 + 2, 4);
//! }
@BobGneu
BobGneu / Rust Documentation - Making Waves 1
Last active March 21, 2018 02:14
Rust Documentation Example 2
//! ## Documentation Example
//!
//! This is a lot of great documentation, you ought to read and maintain this.
//!
//! Somehow i think, you are going to not do that.
//!
//! ```rust
//! fn it_works() {
//! assert_eq!(2 + 2, 4);
//! }
> cargo init documentation_test
Created library project
> cd ./documentation_test
> cargo test
Compiling documentation_test v0.1.0 (file:///C:/documentation_test)
Finished dev [unoptimized + debuginfo] target(s) in 0.50 secs
Running target\debug\deps\documentation_test-4cd8ffe7876c6af7.exe
running 1 test
test tests::it_works ... ok
@BobGneu
BobGneu / gist:c1585cc73d9174fd4684d58470a61d03
Created February 7, 2018 20:26
Rusty Intro - Invalid main function error
> cargo run
Compiling rust_bin v0.1.0 (file:///C:/rust_bin)
error[E0601]: main function not found
error: aborting due to previous error
error: Could not compile `rust_bin`.
@BobGneu
BobGneu / main.rs
Created February 7, 2018 20:23
Rust Intro - What's in main
fn main() {
println!("Hello, world!");
}
@BobGneu
BobGneu / gist:070c9ff68032168c4a65c1631db680b0
Created February 7, 2018 20:22
Rust Intro - Running verbose
> cargo run --verbose
Compiling rust_bin v0.1.0 (file:///C:/rust_bin)
Running `rustc --crate-name rust_bin src\main.rs --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=a2f9914a23e80948 -C extra-filename=-a2f9914a23e80948 --out-dir C:\rust_bin\target\debug\deps -L dependency=C:\rust_bin\target\debug\deps`
Finished dev [unoptimized + debuginfo] target(s) in 0.53 secs
Running `target\debug\rust_bin.exe`
Hello, world!
@BobGneu
BobGneu / gist:adf6b3554bd18a6b8007f0b81f2a6240
Created February 7, 2018 20:17
Rust Intro - Creating a new project 1
> mkdir rust_bin
> cd rust_bin
> cargo init --bin
Created binary (application) project
> cargo run
Compiling rust_bin v0.1.0 (file:///C:/Development/Rust/rust_bin)
Finished dev [unoptimized + debuginfo] target(s) in 0.54 secs
Running `target\debug\rust_bin.exe`
Hello, world!
@BobGneu
BobGneu / init.bat
Created September 13, 2015 22:40
manual build steps for Flathead on Windows
SET PATH=%PATH%;%CD%\deps\depot_tools
CD deps
fetch v8
cd v8
git new-branch flathead