Skip to content

Commit

Permalink
Expose exact lifetimes on True/False methods
Browse files Browse the repository at this point in the history
  • Loading branch information
nvzqz committed Dec 30, 2019
1 parent 659095d commit 441323b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/bool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@ pub struct True;
pub struct False;

impl True {
pub const fn not<'a>(&'a self) -> &'a False {
pub const fn not(&self) -> &'static False {
&False
}
pub const fn and<'a, T>(&'a self, other: &'a T) -> &'a T {
pub const fn and<'a, T>(&self, other: &'a T) -> &'a T {
other
}
pub const fn or<'a, T>(&'a self, _: &'a T) -> &'a True {
pub const fn or<T>(&self, _: &T) -> &'static True {
&True
}
}

impl False {
pub const fn not<'a>(&'a self) -> &'a True {
pub const fn not(&self) -> &'static True {
&True
}
pub const fn and<'a, T>(&'a self, _: &'a T) -> &'a False {
pub const fn and<T>(&self, _: &T) -> &'static False {
&False
}
pub const fn or<'a, T>(&'a self, other: &'a T) -> &'a T {
pub const fn or<'a, T>(&self, other: &'a T) -> &'a T {
other
}
}
Expand Down

0 comments on commit 441323b

Please sign in to comment.