Add license to Flow

This commit is contained in:
Savanni D'Gerinel 2023-02-11 13:05:13 -05:00
parent e60a2fbc30
commit 363a4632b1
4 changed files with 29 additions and 4 deletions

View File

@ -17,6 +17,12 @@ emseries-dev:
emseries-test: emseries-test:
cd emseries && make test cd emseries && make test
flow-dev:
cd flow && make dev
flow-test:
cd flow && make test
fluent-ergonomics-dev: fluent-ergonomics-dev:
cd fluent-ergonomics && make dev cd fluent-ergonomics && make dev

View File

@ -2,6 +2,8 @@
name = "flow" name = "flow"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
license = "GPL-3.0-only"
license-file = "../COPYING"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

5
flow/Makefile Normal file
View File

@ -0,0 +1,5 @@
dev:
cargo watch -x build
test:
cargo watch -x test

View File

@ -1,3 +1,15 @@
/*
Copyright 2023, Savanni D'Gerinel <savanni@luminescent-dreams.com>
This file is part of the Luminescent Dreams Tools.
Luminescent Dreams Tools is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Luminescent Dreams Tools is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Lumeto. If not, see <https://www.gnu.org/licenses/>.
*/
//! Control Flow for Correctness-Critical applications //! Control Flow for Correctness-Critical applications
//! //!
//! https://sled.rs/errors.html //! https://sled.rs/errors.html
@ -113,8 +125,8 @@ pub fn fatal<A, FE: FatalError, E: Error>(err: FE) -> Flow<A, FE, E> {
Flow::Fatal(err) Flow::Fatal(err)
} }
#[macro_export]
/// Return early from the current function if the value is a fatal error. /// Return early from the current function if the value is a fatal error.
#[macro_export]
macro_rules! return_fatal { macro_rules! return_fatal {
($x:expr) => { ($x:expr) => {
match $x { match $x {
@ -149,7 +161,7 @@ mod test {
} }
impl super::FatalError for FatalError {} impl super::FatalError for FatalError {}
impl PartialEq for FatalError { impl PartialEq for FatalError {
fn eq(&self, rhs: &Self) -> bool { fn eq(&self, _rhs: &Self) -> bool {
true true
} }
} }
@ -160,7 +172,7 @@ mod test {
Error, Error,
} }
impl PartialEq for Error { impl PartialEq for Error {
fn eq(&self, rhs: &Self) -> bool { fn eq(&self, _rhs: &Self) -> bool {
true true
} }
} }
@ -218,7 +230,7 @@ mod test {
let value = return_fatal!(error::<i32, FatalError, Error>(Error::Error)); let value = return_fatal!(error::<i32, FatalError, Error>(Error::Error));
match value { match value {
Ok(_) => panic!("shouldn't have gotten here"), Ok(_) => panic!("shouldn't have gotten here"),
Err(err) => ok(0), Err(_) => ok(0),
} }
} }