Skip to content

Commit

Permalink
Fix lifetime errors
Browse files Browse the repository at this point in the history
  • Loading branch information
twizmwazin committed Nov 12, 2024
1 parent 8a9bfe6 commit 0c760bf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions crates/clarirs_core/src/algorithms/simplify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ macro_rules! simplify {
}

pub trait Simplify<'c>: Sized {
fn simplify(&'c self) -> Result<Self, ClarirsError>;
fn simplify(&self) -> Result<Self, ClarirsError>;
}

impl<'c> Simplify<'c> for BoolAst<'c> {
fn simplify(&'c self) -> Result<Self, ClarirsError> {
fn simplify(&self) -> Result<Self, ClarirsError> {

Check warning on line 24 in crates/clarirs_core/src/algorithms/simplify.rs

View workflow job for this annotation

GitHub Actions / cargo fmt

Diff in /home/runner/work/clarirs/clarirs/crates/clarirs_core/src/algorithms/simplify.rs
let ctx = self.context();

self.context()
Expand Down Expand Up @@ -288,7 +288,7 @@ impl<'c> Simplify<'c> for BoolAst<'c> {
}

impl<'c> Simplify<'c> for BitVecAst<'c> {
fn simplify(&'c self) -> Result<Self, ClarirsError> {
fn simplify(&self) -> Result<Self, ClarirsError> {
let ctx = self.context();

self.context()
Expand Down Expand Up @@ -823,7 +823,7 @@ impl<'c> Simplify<'c> for BitVecAst<'c> {
}

impl<'c> Simplify<'c> for FloatAst<'c> {
fn simplify(&'c self) -> Result<Self, ClarirsError> {
fn simplify(&self) -> Result<Self, ClarirsError> {
let ctx = self.context();

self.context()
Expand Down Expand Up @@ -950,7 +950,7 @@ impl<'c> Simplify<'c> for FloatAst<'c> {
}

impl<'c> Simplify<'c> for StringAst<'c> {
fn simplify(&'c self) -> Result<Self, ClarirsError> {
fn simplify(&self) -> Result<Self, ClarirsError> {
let ctx = self.context();

self.context()
Expand Down
4 changes: 2 additions & 2 deletions crates/clarirs_core/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ impl<'c> AstFactory<'c> for Context<'c> {
}

pub trait HasContext<'c> {
fn context(&self) -> &Context<'c>;
fn context(&self) -> &'c Context<'c>;
}

impl<'c, T> HasContext<'c> for Arc<T>
where
T: HasContext<'c>,
{
fn context(&self) -> &Context<'c> {
fn context(&self) -> &'c Context<'c> {
self.as_ref().context()
}
}

0 comments on commit 0c760bf

Please sign in to comment.