diff --git a/arithmetic-coding-core/src/model.rs b/arithmetic-coding-core/src/model.rs index fd28896..8706889 100644 --- a/arithmetic-coding-core/src/model.rs +++ b/arithmetic-coding-core/src/model.rs @@ -15,9 +15,8 @@ pub mod one_shot; /// # Example /// /// ``` -/// #![feature(exclusive_range_pattern)] -/// #![feature(never_type)] -/// # use std::ops::Range; +/// # use std::convert::Infallible; +/// use std::ops::Range; /// # /// # use arithmetic_coding_core::Model; /// @@ -32,9 +31,9 @@ pub mod one_shot; /// impl Model for MyModel { /// type B = u32; /// type Symbol = Symbol; -/// type ValueError = !; +/// type ValueError = Infallible; /// -/// fn probability(&self, symbol: Option<&Self::Symbol>) -> Result, !> { +/// fn probability(&self, symbol: Option<&Self::Symbol>) -> Result, Infallible> { /// Ok(match symbol { /// None => 0..1, /// Some(&Symbol::A) => 1..2, diff --git a/arithmetic-coding-core/src/model/fixed_length.rs b/arithmetic-coding-core/src/model/fixed_length.rs index 9f6fa79..369ce67 100644 --- a/arithmetic-coding-core/src/model/fixed_length.rs +++ b/arithmetic-coding-core/src/model/fixed_length.rs @@ -20,7 +20,7 @@ use crate::BitStore; /// # Example /// /// ``` -/// #![feature(never_type)] +/// # use std::convert::Infallible; /// # use std::ops::Range; /// # /// # use arithmetic_coding_core::fixed_length; @@ -36,9 +36,9 @@ use crate::BitStore; /// impl fixed_length::Model for MyModel { /// type B = u32; /// type Symbol = Symbol; -/// type ValueError = !; +/// type ValueError = Infallible; /// -/// fn probability(&self, symbol: &Self::Symbol) -> Result, !> { +/// fn probability(&self, symbol: &Self::Symbol) -> Result, Infallible> { /// Ok(match symbol { /// Symbol::A => 0..1, /// Symbol::B => 1..2, diff --git a/arithmetic-coding-core/src/model/max_length.rs b/arithmetic-coding-core/src/model/max_length.rs index 63f629d..cda0e93 100644 --- a/arithmetic-coding-core/src/model/max_length.rs +++ b/arithmetic-coding-core/src/model/max_length.rs @@ -22,7 +22,7 @@ use crate::BitStore; /// # Example /// /// ``` -/// #![feature(never_type)] +/// # use std::convert::Infallible; /// # use std::ops::Range; /// # /// # use arithmetic_coding_core::max_length; @@ -38,9 +38,9 @@ use crate::BitStore; /// impl max_length::Model for MyModel { /// type B = u32; /// type Symbol = Symbol; -/// type ValueError = !; +/// type ValueError = Infallible; /// -/// fn probability(&self, symbol: Option<&Self::Symbol>) -> Result, !> { +/// fn probability(&self, symbol: Option<&Self::Symbol>) -> Result, Infallible> { /// Ok(match symbol { /// Some(Symbol::A) => 0..1, /// Some(Symbol::B) => 1..2, diff --git a/arithmetic-coding-core/src/model/one_shot.rs b/arithmetic-coding-core/src/model/one_shot.rs index c6b870c..1c667a9 100644 --- a/arithmetic-coding-core/src/model/one_shot.rs +++ b/arithmetic-coding-core/src/model/one_shot.rs @@ -23,7 +23,7 @@ use crate::{fixed_length, BitStore}; /// # Example /// /// ``` -/// #![feature(never_type)] +/// # use std::convert::Infallible; /// # use std::ops::Range; /// # /// # use arithmetic_coding_core::one_shot; @@ -39,9 +39,9 @@ use crate::{fixed_length, BitStore}; /// impl one_shot::Model for MyModel { /// type B = u32; /// type Symbol = Symbol; -/// type ValueError = !; +/// type ValueError = Infallible; /// -/// fn probability(&self, symbol: &Self::Symbol) -> Result, !> { +/// fn probability(&self, symbol: &Self::Symbol) -> Result, Infallible> { /// Ok(match symbol { /// Symbol::A => 0..1, /// Symbol::B => 1..2, diff --git a/examples/concatenated.rs b/examples/concatenated.rs index eabfc5f..1b42fee 100644 --- a/examples/concatenated.rs +++ b/examples/concatenated.rs @@ -1,5 +1,3 @@ -#![feature(never_type)] - use arithmetic_coding::{Decoder, Encoder, Model}; use bitstream_io::{BigEndian, BitRead, BitReader, BitWrite, BitWriter}; @@ -47,7 +45,7 @@ mod integer { } mod symbolic { - use std::ops::Range; + use std::{convert::Infallible, ops::Range}; #[derive(Debug)] pub enum Symbol { @@ -61,9 +59,9 @@ mod symbolic { impl arithmetic_coding::Model for Model { type B = u32; type Symbol = Symbol; - type ValueError = !; + type ValueError = Infallible; - fn probability(&self, symbol: Option<&Self::Symbol>) -> Result, !> { + fn probability(&self, symbol: Option<&Self::Symbol>) -> Result, Infallible> { Ok(match symbol { None => 0..1, Some(&Symbol::A) => 1..2, diff --git a/examples/fixed_length.rs b/examples/fixed_length.rs index 51393ed..75bfc20 100644 --- a/examples/fixed_length.rs +++ b/examples/fixed_length.rs @@ -1,6 +1,4 @@ -#![feature(never_type)] - -use std::ops::Range; +use std::{convert::Infallible, ops::Range}; use arithmetic_coding::fixed_length; @@ -19,7 +17,7 @@ pub struct MyModel; impl fixed_length::Model for MyModel { type B = u32; type Symbol = Symbol; - type ValueError = !; + type ValueError = Infallible; fn probability(&self, symbol: &Self::Symbol) -> Result, Self::ValueError> { match symbol { diff --git a/examples/max_length.rs b/examples/max_length.rs index 1d0a4c5..928260a 100644 --- a/examples/max_length.rs +++ b/examples/max_length.rs @@ -1,6 +1,4 @@ -#![feature(never_type)] - -use std::ops::Range; +use std::{convert::Infallible, ops::Range}; use arithmetic_coding::max_length; @@ -19,7 +17,7 @@ pub struct MyModel; impl max_length::Model for MyModel { type B = u32; type Symbol = Symbol; - type ValueError = !; + type ValueError = Infallible; fn probability(&self, symbol: Option<&Self::Symbol>) -> Result, Self::ValueError> { match symbol { diff --git a/examples/symbolic.rs b/examples/symbolic.rs index 55861ee..bfd53ec 100644 --- a/examples/symbolic.rs +++ b/examples/symbolic.rs @@ -1,6 +1,4 @@ -#![feature(never_type)] - -use std::ops::Range; +use std::{convert::Infallible, ops::Range}; use arithmetic_coding::Model; @@ -19,9 +17,9 @@ pub struct MyModel; impl Model for MyModel { type B = u32; type Symbol = Symbol; - type ValueError = !; + type ValueError = Infallible; - fn probability(&self, symbol: Option<&Self::Symbol>) -> Result, !> { + fn probability(&self, symbol: Option<&Self::Symbol>) -> Result, Infallible> { Ok(match symbol { None => 0..1, Some(&Symbol::A) => 1..2, diff --git a/tests/concatenated.rs b/tests/concatenated.rs index 798dc08..be36b03 100644 --- a/tests/concatenated.rs +++ b/tests/concatenated.rs @@ -1,5 +1,3 @@ -#![feature(never_type)] - use arithmetic_coding::{Decoder, Encoder, Model}; use bitstream_io::{BigEndian, BitRead, BitReader, BitWrite, BitWriter}; use symbolic::Symbol; @@ -48,7 +46,7 @@ mod integer { } mod symbolic { - use std::ops::Range; + use std::{convert::Infallible, ops::Range}; #[derive(Debug, PartialEq, Eq)] pub enum Symbol { @@ -62,9 +60,9 @@ mod symbolic { impl arithmetic_coding::Model for Model { type B = u32; type Symbol = Symbol; - type ValueError = !; + type ValueError = Infallible; - fn probability(&self, symbol: Option<&Self::Symbol>) -> Result, !> { + fn probability(&self, symbol: Option<&Self::Symbol>) -> Result, Infallible> { Ok(match symbol { None => 0..1, Some(&Symbol::A) => 1..2, diff --git a/tests/fixed_length.rs b/tests/fixed_length.rs index d2c7c2e..92b791b 100644 --- a/tests/fixed_length.rs +++ b/tests/fixed_length.rs @@ -1,6 +1,4 @@ -#![feature(never_type)] - -use std::ops::Range; +use std::{convert::Infallible, ops::Range}; use arithmetic_coding::fixed_length; @@ -19,7 +17,7 @@ pub struct MyModel; impl fixed_length::Model for MyModel { type B = u32; type Symbol = Symbol; - type ValueError = !; + type ValueError = Infallible; fn probability(&self, symbol: &Self::Symbol) -> Result, Self::ValueError> { match symbol { diff --git a/tests/max_length.rs b/tests/max_length.rs index 08a7fb4..8f2e3d4 100644 --- a/tests/max_length.rs +++ b/tests/max_length.rs @@ -1,6 +1,4 @@ -#![feature(never_type)] - -use std::ops::Range; +use std::{convert::Infallible, ops::Range}; use arithmetic_coding::max_length; use test_case::test_case; @@ -20,7 +18,7 @@ pub struct MyModel; impl max_length::Model for MyModel { type B = u32; type Symbol = Symbol; - type ValueError = !; + type ValueError = Infallible; fn probability(&self, symbol: Option<&Self::Symbol>) -> Result, Self::ValueError> { match symbol {