Skip to content

Commit

Permalink
Version increase to 0.6.0 with stable 128-bit integers
Browse files Browse the repository at this point in the history
  • Loading branch information
myrrlyn committed Jun 25, 2018
1 parent 6a40093 commit 7ab7668
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 22 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 0.6.0

### Changed

Increased the minimum Rust version to 1.26.0 and removed the feature gate for
128-bit integers, which are now available by default.

Also overhaul the Justfile scripts to ease development.

## 0.5.0

### Changed
Expand Down
5 changes: 2 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "endian_trait"
version = "0.5.0"
version = "0.6.0"
authors = [
"myrrlyn <myrrlyn@outlook.com>",
]
Expand All @@ -17,11 +17,10 @@ exclude = [

[dependencies.endian_trait_derive]
path = "endian_trait_derive"
version = "0.5.0"
version = "0.6.0"

[features]
arrays = []
e128 = []

[workspace]
members = [
Expand Down
6 changes: 5 additions & 1 deletion Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ build:
doc: test
cargo doc

pack: doc
just endian_trait_derive/pack
cargo package

publish: doc
# Publish derive first, since this depends on it
just endian_trait_derive/publish
cargo publish

test: build
cargo test --features arrays
cargo +nightly test --features arrays,e128
cargo +nightly test --features arrays
4 changes: 4 additions & 0 deletions endian_trait_derive/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

List of notable changes to the custom-derive macro for the `Endian` trait.

## 0.6.0

Update the docs a bit and bump the version in sync with the main crate.

## 0.5.0

Updated `CONTRIBUTING.md` to reflect that this crate is more or less feature
Expand Down
3 changes: 2 additions & 1 deletion endian_trait_derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "endian_trait_derive"
version = "0.5.0"
version = "0.6.0"
authors = [
"myrrlyn <myrrlyn@outlook.com>",
]
Expand All @@ -19,6 +19,7 @@ exclude = [

[lib]
proc-macro = true
doctest = false

[dependencies]
quote = "0.4"
Expand Down
6 changes: 4 additions & 2 deletions endian_trait_derive/Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ build:
cargo check
cargo build

publish: build
pack: build
cargo package

publish: pack
cargo publish
rm -r target/
2 changes: 1 addition & 1 deletion endian_trait_derive/rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.20.0
1.26.0
4 changes: 2 additions & 2 deletions endian_trait_derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ and consumer are the same Rust version.
This crate shouldn't be used directly; use
```rust,ignore
```rust,no-run
#[macro_use]
extern crate endian_trait;
# fn main() {}
Expand All @@ -32,7 +32,7 @@ By itself, this crate provides a custom-derive macro to emit a trait impl block
that is syntactically valid but will fail to compile without the `endian_trait`
crate and `Endian` trait in scope.
```rust,ignore
```rust
#[macro_use]
extern crate endian_trait;
# // This is needed because of the fact that the test is executed from within
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.20.0
1.26.0
18 changes: 7 additions & 11 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ to `::std::i32::from_be(n: i32)`

#![deny(missing_docs)]

#![cfg_attr(
feature = "e128",
feature(i128_type)
)]

// Re-export the custom-derive so that users don't need two crates explicitly.
#[allow(unused_imports)]
#[macro_use]
Expand Down Expand Up @@ -53,15 +48,19 @@ pub trait Endian {
macro_rules! implendian {
( $( $t:tt ),* ) => { $(
impl Endian for $t {
#[inline(always)]
fn from_be(self) -> Self {
$t::from_be(self)
}
#[inline(always)]
fn from_le(self) -> Self {
$t::from_le(self)
}
#[inline(always)]
fn to_be(self) -> Self {
$t::to_be(self)
}
#[inline(always)]
fn to_le(self) -> Self {
$t::to_le(self)
}
Expand Down Expand Up @@ -163,15 +162,12 @@ impl Endian for char {
}

// Implement on the integer primitives
implendian!(i8, u8, i16, u16, i32, u32, i64, u64);

#[cfg(feature = "e128")]
implendian!(i128, u128);
implendian!(i8, u8, i16, u16, i32, u32, i64, u64, i128, u128);

// Implement on floats
implendian_f!(f32, f64);

#[cfg(feature = "arrays")]
pub mod arrays;
mod arrays;

pub mod slices;
mod slices;

0 comments on commit 7ab7668

Please sign in to comment.