From a2c166c6593aef3bb46bc62a6308f1b4710572a8 Mon Sep 17 00:00:00 2001 From: Ben Lovy Date: Sun, 3 Jan 2021 10:19:03 -0500 Subject: [PATCH] Initial commit --- .gitignore | 2 ++ Cargo.toml | 10 ++++++++++ LICENSE | 11 +++++++++++ README.md | 3 +++ src/bin/fcalc.rs | 10 ++++++++++ src/lib.rs | 8 ++++++++ 6 files changed, 44 insertions(+) create mode 100644 .gitignore create mode 100644 Cargo.toml create mode 100644 LICENSE create mode 100644 README.md create mode 100644 src/bin/fcalc.rs create mode 100644 src/lib.rs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..96ef6c0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/target +Cargo.lock diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..879b98c --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "fcalc" +version = "0.1.0" +authors = ["Ben Lovy "] +edition = "2018" +license = "BSD-3-Clause" + +[dependencies] + +lazy_static = "1.4" \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a24b3c0 --- /dev/null +++ b/LICENSE @@ -0,0 +1,11 @@ +Copyright 2020 Ben Lovy + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIAB diff --git a/README.md b/README.md new file mode 100644 index 0000000..390a69c --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# fcalc + +Factorio recipe calculator. \ No newline at end of file diff --git a/src/bin/fcalc.rs b/src/bin/fcalc.rs new file mode 100644 index 0000000..63a7fca --- /dev/null +++ b/src/bin/fcalc.rs @@ -0,0 +1,10 @@ +use std::env::var; +use lazy_static::lazy_static; + +lazy_static! { + pub static ref VERSION: String = var("CARGO_PKG_VERSION").unwrap(); +} + +fn main() { + println!("fcalc {} - Factorio Calculator", *VERSION); +} \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..d3126d3 --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,8 @@ + +#[cfg(test)] +mod tests { + #[test] + fn it_works() { + assert_eq!(2 + 2, 4); + } +} -- 2.38.5