mirror of
https://github.com/lune-org/lune.git
synced 2025-01-05 19:09:10 +00:00
Elide lifetimes where possible
This commit is contained in:
parent
805b9d89ad
commit
e3e56301ce
1 changed files with 18 additions and 18 deletions
|
@ -191,11 +191,11 @@ impl<'fut> TaskScheduler<'fut> {
|
||||||
for it, as well as the arguments to give the
|
for it, as well as the arguments to give the
|
||||||
thread on resumption, in the Lua registry.
|
thread on resumption, in the Lua registry.
|
||||||
*/
|
*/
|
||||||
fn create_task<'a>(
|
fn create_task(
|
||||||
&self,
|
&self,
|
||||||
kind: TaskKind,
|
kind: TaskKind,
|
||||||
thread_or_function: LuaValue<'a>,
|
thread_or_function: LuaValue<'_>,
|
||||||
thread_args: Option<LuaMultiValue<'a>>,
|
thread_args: Option<LuaMultiValue<'_>>,
|
||||||
) -> LuaResult<TaskReference> {
|
) -> LuaResult<TaskReference> {
|
||||||
// Get or create a thread from the given argument
|
// Get or create a thread from the given argument
|
||||||
let task_thread = match thread_or_function {
|
let task_thread = match thread_or_function {
|
||||||
|
@ -244,11 +244,11 @@ impl<'fut> TaskScheduler<'fut> {
|
||||||
-- Here we have either yielded or finished the above task
|
-- Here we have either yielded or finished the above task
|
||||||
```
|
```
|
||||||
*/
|
*/
|
||||||
fn schedule<'a>(
|
fn schedule(
|
||||||
&self,
|
&self,
|
||||||
kind: TaskKind,
|
kind: TaskKind,
|
||||||
thread_or_function: LuaValue<'a>,
|
thread_or_function: LuaValue<'_>,
|
||||||
thread_args: Option<LuaMultiValue<'a>>,
|
thread_args: Option<LuaMultiValue<'_>>,
|
||||||
after_current_resume: bool,
|
after_current_resume: bool,
|
||||||
) -> LuaResult<TaskReference> {
|
) -> LuaResult<TaskReference> {
|
||||||
if kind == TaskKind::Future {
|
if kind == TaskKind::Future {
|
||||||
|
@ -278,10 +278,10 @@ impl<'fut> TaskScheduler<'fut> {
|
||||||
Ok(task_ref)
|
Ok(task_ref)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn schedule_current_resume<'a>(
|
pub fn schedule_current_resume(
|
||||||
&self,
|
&self,
|
||||||
thread_or_function: LuaValue<'a>,
|
thread_or_function: LuaValue<'_>,
|
||||||
thread_args: LuaMultiValue<'a>,
|
thread_args: LuaMultiValue<'_>,
|
||||||
) -> LuaResult<TaskReference> {
|
) -> LuaResult<TaskReference> {
|
||||||
self.schedule(
|
self.schedule(
|
||||||
TaskKind::Instant,
|
TaskKind::Instant,
|
||||||
|
@ -291,10 +291,10 @@ impl<'fut> TaskScheduler<'fut> {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn schedule_after_current_resume<'a>(
|
pub fn schedule_after_current_resume(
|
||||||
&self,
|
&self,
|
||||||
thread_or_function: LuaValue<'a>,
|
thread_or_function: LuaValue<'_>,
|
||||||
thread_args: LuaMultiValue<'a>,
|
thread_args: LuaMultiValue<'_>,
|
||||||
) -> LuaResult<TaskReference> {
|
) -> LuaResult<TaskReference> {
|
||||||
self.schedule(
|
self.schedule(
|
||||||
TaskKind::Instant,
|
TaskKind::Instant,
|
||||||
|
@ -304,10 +304,10 @@ impl<'fut> TaskScheduler<'fut> {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn schedule_deferred<'a>(
|
pub fn schedule_deferred(
|
||||||
&self,
|
&self,
|
||||||
thread_or_function: LuaValue<'a>,
|
thread_or_function: LuaValue<'_>,
|
||||||
thread_args: LuaMultiValue<'a>,
|
thread_args: LuaMultiValue<'_>,
|
||||||
) -> LuaResult<TaskReference> {
|
) -> LuaResult<TaskReference> {
|
||||||
self.schedule(
|
self.schedule(
|
||||||
TaskKind::Deferred,
|
TaskKind::Deferred,
|
||||||
|
@ -317,11 +317,11 @@ impl<'fut> TaskScheduler<'fut> {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn schedule_delayed<'a>(
|
pub fn schedule_delayed(
|
||||||
&self,
|
&self,
|
||||||
after_secs: f64,
|
after_secs: f64,
|
||||||
thread_or_function: LuaValue<'a>,
|
thread_or_function: LuaValue<'_>,
|
||||||
thread_args: LuaMultiValue<'a>,
|
thread_args: LuaMultiValue<'_>,
|
||||||
) -> LuaResult<TaskReference> {
|
) -> LuaResult<TaskReference> {
|
||||||
let task_ref = self.create_task(TaskKind::Future, thread_or_function, Some(thread_args))?;
|
let task_ref = self.create_task(TaskKind::Future, thread_or_function, Some(thread_args))?;
|
||||||
let futs = self
|
let futs = self
|
||||||
|
|
Loading…
Reference in a new issue