mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15:28 +00:00
use FnOnce for callback function
This commit is contained in:
parent
65237abee0
commit
7315f57a4b
3 changed files with 7 additions and 19 deletions
|
|
@ -42,7 +42,7 @@ impl Client {
|
|||
|
||||
/// Begin new request
|
||||
/// * the `query` as string, to support system routes (e.g. `source:` prefix)
|
||||
pub fn request_async(&self, request: &str, callback: impl Fn(Response) + 'static) {
|
||||
pub fn request_async(&self, request: &str, callback: impl FnOnce(Response) + 'static) {
|
||||
// Update client status
|
||||
self.status.replace(Status::Request {
|
||||
time: now(),
|
||||
|
|
@ -52,7 +52,7 @@ impl Client {
|
|||
self.driver.feature_async(
|
||||
Feature::from_string(request),
|
||||
self.new_cancellable(),
|
||||
Rc::new(callback),
|
||||
callback,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue