From 363a4632b1ec5ce7824e44056a188454c1920f5a Mon Sep 17 00:00:00 2001 From: Savanni D'Gerinel Date: Sat, 11 Feb 2023 13:05:13 -0500 Subject: [PATCH] Add license to Flow --- Makefile | 6 ++++++ flow/Cargo.toml | 2 ++ flow/Makefile | 5 +++++ flow/src/lib.rs | 20 ++++++++++++++++---- 4 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 flow/Makefile diff --git a/Makefile b/Makefile index 89d33bf..27bdf2f 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,12 @@ emseries-dev: emseries-test: cd emseries && make test +flow-dev: + cd flow && make dev + +flow-test: + cd flow && make test + fluent-ergonomics-dev: cd fluent-ergonomics && make dev diff --git a/flow/Cargo.toml b/flow/Cargo.toml index b90bacc..27769c2 100644 --- a/flow/Cargo.toml +++ b/flow/Cargo.toml @@ -2,6 +2,8 @@ name = "flow" version = "0.1.0" 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 diff --git a/flow/Makefile b/flow/Makefile new file mode 100644 index 0000000..b6cfc41 --- /dev/null +++ b/flow/Makefile @@ -0,0 +1,5 @@ +dev: + cargo watch -x build + +test: + cargo watch -x test diff --git a/flow/src/lib.rs b/flow/src/lib.rs index 6356e26..28198a2 100644 --- a/flow/src/lib.rs +++ b/flow/src/lib.rs @@ -1,3 +1,15 @@ +/* +Copyright 2023, Savanni D'Gerinel + +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 . +*/ + //! Control Flow for Correctness-Critical applications //! //! https://sled.rs/errors.html @@ -113,8 +125,8 @@ pub fn fatal(err: FE) -> Flow { Flow::Fatal(err) } -#[macro_export] /// Return early from the current function if the value is a fatal error. +#[macro_export] macro_rules! return_fatal { ($x:expr) => { match $x { @@ -149,7 +161,7 @@ mod test { } impl super::FatalError for FatalError {} impl PartialEq for FatalError { - fn eq(&self, rhs: &Self) -> bool { + fn eq(&self, _rhs: &Self) -> bool { true } } @@ -160,7 +172,7 @@ mod test { Error, } impl PartialEq for Error { - fn eq(&self, rhs: &Self) -> bool { + fn eq(&self, _rhs: &Self) -> bool { true } } @@ -218,7 +230,7 @@ mod test { let value = return_fatal!(error::(Error::Error)); match value { Ok(_) => panic!("shouldn't have gotten here"), - Err(err) => ok(0), + Err(_) => ok(0), } }