Skip to content

Commit 1af2b78

Browse files
committed
Change license to 0BSD
This is equivalent to MIT without the attribution requirement.
1 parent 293f7b8 commit 1af2b78

File tree

6 files changed

+32
-34
lines changed

6 files changed

+32
-34
lines changed

LICENSE

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
1-
Copyright 2018 Stephane Raux
1+
Copyright (C) 2018-2021 Stephane Raux
22

3-
Permission is hereby granted, free of charge, to any person obtaining a copy of
4-
this software and associated documentation files (the "Software"), to deal in
5-
the Software without restriction, including without limitation the rights to
6-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7-
of the Software, and to permit persons to whom the Software is furnished to do
8-
so, subject to the following conditions:
3+
Permission to use, copy, modify, and/or distribute this software for any
4+
purpose with or without fee is hereby granted.
95

10-
The above copyright notice and this permission notice shall be included in all
11-
copies or substantial portions of the Software.
12-
13-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19-
SOFTWARE.
6+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
7+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
8+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
9+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
10+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
11+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
12+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
[![Documentation](https://docs.rs/enum-iterator/badge.svg)](https://docs.rs/enum-iterator)
22
[![Crate](https://img.shields.io/crates/v/enum-iterator.svg)](https://crates.io/crates/enum-iterator)
3-
[![MIT license](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)
43

54
# Purpose
65

enum-iterator-derive/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.6.0"
44
authors = ["Stephane Raux <stephaneyfx@gmail.com>"]
55
edition = "2018"
66
description = "Procedural macro to iterate over the variants of a field-less enum"
7-
license = "MIT"
7+
license = "0BSD"
88
homepage = "https://github.com/stephaneyfx/enum-iterator"
99
repository = "https://github.com/stephaneyfx/enum-iterator.git"
1010
documentation = "https://docs.rs/enum-iterator-derive"

enum-iterator-derive/src/lib.rs

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2018-2019 Stephane Raux. Distributed under the MIT license.
1+
// Copyright (C) 2018-2019 Stephane Raux. Distributed under the 0BSD license.
22

33
//! Procedural macro to derive `IntoEnumIterator` for field-less enums.
44
//!
@@ -11,13 +11,15 @@ extern crate proc_macro;
1111

1212
use proc_macro2::{Span, TokenStream};
1313
use quote::{quote, ToTokens};
14-
use std::fmt::{Display, self};
15-
use syn::{Ident, DeriveInput};
14+
use std::fmt::{self, Display};
15+
use syn::{DeriveInput, Ident};
1616

1717
/// Derives `IntoEnumIterator` for field-less enums.
1818
#[proc_macro_derive(IntoEnumIterator)]
1919
pub fn into_enum_iterator(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
20-
derive(input).unwrap_or_else(|e| e.to_compile_error()).into()
20+
derive(input)
21+
.unwrap_or_else(|e| e.to_compile_error())
22+
.into()
2123
}
2224

2325
fn derive(input: proc_macro::TokenStream) -> Result<TokenStream, syn::Error> {
@@ -33,7 +35,9 @@ fn derive(input: proc_macro::TokenStream) -> Result<TokenStream, syn::Error> {
3335
syn::Data::Enum(e) => &e.variants,
3436
_ => return Err(Error::ExpectedEnum.with_tokens(&ast)),
3537
};
36-
let arms = variants.iter().enumerate()
38+
let arms = variants
39+
.iter()
40+
.enumerate()
3741
.map(|(idx, v)| {
3842
let id = &v.ident;
3943
match v.fields {
@@ -105,13 +109,16 @@ impl Error {
105109
impl Display for Error {
106110
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
107111
match self {
108-
Error::ExpectedEnum =>
109-
f.write_str("IntoEnumIterator can only be derived for enum types"),
110-
Error::ExpectedUnitVariant =>
111-
f.write_str("IntoEnumIterator can only be derived for enum types with unit \
112-
variants only"),
113-
Error::GenericsUnsupported =>
114-
f.write_str("IntoEnumIterator cannot be derived for generic types"),
112+
Error::ExpectedEnum => {
113+
f.write_str("IntoEnumIterator can only be derived for enum types")
114+
}
115+
Error::ExpectedUnitVariant => f.write_str(
116+
"IntoEnumIterator can only be derived for enum types with unit \
117+
variants only",
118+
),
119+
Error::GenericsUnsupported => {
120+
f.write_str("IntoEnumIterator cannot be derived for generic types")
121+
}
115122
}
116123
}
117124
}

enum-iterator/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.6.0"
44
authors = ["Stephane Raux <stephaneyfx@gmail.com>"]
55
edition = "2018"
66
description = "Tools to iterate over the variants of a field-less enum"
7-
license = "MIT"
7+
license = "0BSD"
88
homepage = "https://github.com/stephaneyfx/enum-iterator"
99
repository = "https://github.com/stephaneyfx/enum-iterator.git"
1010
documentation = "https://docs.rs/enum-iterator"

enum-iterator/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
// Copyright (C) 2018-2019 Stephane Raux. Distributed under the MIT license.
1+
// Copyright (C) 2018-2019 Stephane Raux. Distributed under the 0BSD license.
22

33
//! Tools to iterate over the variants of a field-less enum.
44
//!
55
//! See the `IntoEnumIterator` trait.
66
77
#![deny(missing_docs)]
88
#![deny(warnings)]
9-
109
#![no_std]
1110

1211
pub use enum_iterator_derive::IntoEnumIterator;

0 commit comments

Comments
 (0)