Skip to content

Instantly share code, notes, and snippets.

@17cupsofcoffee
Last active March 2, 2019 17:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 17cupsofcoffee/0056a7645e31796673eb4e6e4fd944ce to your computer and use it in GitHub Desktop.
Save 17cupsofcoffee/0056a7645e31796673eb4e6e4fd944ce to your computer and use it in GitHub Desktop.
main and lib in the same crate
pub fn in_bar() {
println!("bar");
}
[package]
name = "example"
version = "0.1.0"
authors = ["Joe Clay <27cupsofcoffee@gmail.com>"]
edition = "2018"
[dependencies]
use crate::bar::in_bar;
pub fn in_foo() {
in_bar();
}
pub mod bar;
pub mod foo;
use example::bar::in_bar;
use example::foo::in_foo;
fn main() {
in_foo();
in_bar();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment