Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename &mut Demand arguments to 'demand' #267

Merged
merged 1 commit into from
Aug 31, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Rename &mut Demand arguments to 'demand'
dtolnay committed Aug 31, 2022

Verified

This commit was signed with the committer’s verified signature.
dtolnay David Tolnay
commit 1b298fe98174342931f31a94b2d50474d789d764
4 changes: 2 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
@@ -34,8 +34,8 @@ const PROBE: &str = r#"
}
impl Error for E {
fn provide<'a>(&'a self, req: &mut Demand<'a>) {
req.provide_ref(&self.backtrace);
fn provide<'a>(&'a self, demand: &mut Demand<'a>) {
demand.provide_ref(&self.backtrace);
}
}
10 changes: 5 additions & 5 deletions src/context.rs
Original file line number Diff line number Diff line change
@@ -128,8 +128,8 @@ where
}

#[cfg(backtrace)]
fn provide<'a>(&'a self, req: &mut Demand<'a>) {
self.error.provide(req);
fn provide<'a>(&'a self, demand: &mut Demand<'a>) {
self.error.provide(demand);
}
}

@@ -142,9 +142,9 @@ where
}

#[cfg(backtrace)]
fn provide<'a>(&'a self, req: &mut Demand<'a>) {
req.provide_ref(self.error.backtrace());
self.error.provide(req);
fn provide<'a>(&'a self, demand: &mut Demand<'a>) {
demand.provide_ref(self.error.backtrace());
self.error.provide(demand);
}
}

10 changes: 5 additions & 5 deletions src/error.rs
Original file line number Diff line number Diff line change
@@ -896,11 +896,11 @@ impl ErrorImpl {
}

#[cfg(backtrace)]
unsafe fn provide<'a>(this: Ref<'a, Self>, req: &mut Demand<'a>) {
unsafe fn provide<'a>(this: Ref<'a, Self>, demand: &mut Demand<'a>) {
if let Some(backtrace) = &this.deref().backtrace {
req.provide_ref(backtrace);
demand.provide_ref(backtrace);
}
Self::error(this).provide(req);
Self::error(this).provide(demand);
}

#[cold]
@@ -918,8 +918,8 @@ where
}

#[cfg(backtrace)]
fn provide<'a>(&'a self, req: &mut Demand<'a>) {
unsafe { ErrorImpl::provide(self.erase(), req) }
fn provide<'a>(&'a self, demand: &mut Demand<'a>) {
unsafe { ErrorImpl::provide(self.erase(), demand) }
}
}

4 changes: 2 additions & 2 deletions src/wrapper.rs
Original file line number Diff line number Diff line change
@@ -75,7 +75,7 @@ impl StdError for BoxedError {
}

#[cfg(backtrace)]
fn provide<'a>(&'a self, req: &mut Demand<'a>) {
self.0.provide(req);
fn provide<'a>(&'a self, demand: &mut Demand<'a>) {
self.0.provide(demand);
}
}