Remove unnecessary 'static bounds

This commit is contained in:
Laurenz 2023-09-26 13:42:11 +02:00
parent c8ebcd70d6
commit 2fd0291a81
2 changed files with 7 additions and 10 deletions

View File

@ -27,7 +27,7 @@ use crate::World;
/// When `explicit` is `true`, the user requested the completion by pressing
/// control and space or something similar.
pub fn autocomplete(
world: &(dyn World + 'static),
world: &dyn World,
frames: &[Frame],
source: &Source,
cursor: usize,
@ -944,7 +944,7 @@ fn code_completions(ctx: &mut CompletionContext, hashtag: bool) {
/// Context for autocompletion.
struct CompletionContext<'a> {
world: &'a (dyn World + 'static),
world: &'a (dyn World + 'a),
frames: &'a [Frame],
library: &'a Library,
global: &'a Scope,
@ -963,7 +963,7 @@ struct CompletionContext<'a> {
impl<'a> CompletionContext<'a> {
/// Create a new autocompletion context.
fn new(
world: &'a (dyn World + 'static),
world: &'a (dyn World + 'a),
frames: &'a [Frame],
source: &'a Source,
cursor: usize,

View File

@ -16,7 +16,7 @@ use crate::World;
/// Describe the item under the cursor.
pub fn tooltip(
world: &(dyn World + 'static),
world: &dyn World,
frames: &[Frame],
source: &Source,
cursor: usize,
@ -43,7 +43,7 @@ pub enum Tooltip {
}
/// Tooltip for a hovered expression.
fn expr_tooltip(world: &(dyn World + 'static), leaf: &LinkedNode) -> Option<Tooltip> {
fn expr_tooltip(world: &dyn World, leaf: &LinkedNode) -> Option<Tooltip> {
let mut ancestor = leaf;
while !ancestor.is::<ast::Expr>() {
ancestor = ancestor.parent()?;
@ -143,7 +143,7 @@ fn length_tooltip(length: Length) -> Option<Tooltip> {
/// Tooltip for a hovered reference.
fn ref_tooltip(
world: &(dyn World + 'static),
world: &dyn World,
frames: &[Frame],
leaf: &LinkedNode,
) -> Option<Tooltip> {
@ -162,10 +162,7 @@ fn ref_tooltip(
}
/// Tooltips for components of a named parameter.
fn named_param_tooltip(
world: &(dyn World + 'static),
leaf: &LinkedNode,
) -> Option<Tooltip> {
fn named_param_tooltip(world: &dyn World, leaf: &LinkedNode) -> Option<Tooltip> {
let (func, named) = if_chain! {
// Ensure that we are in a named pair in the arguments to a function
// call or set rule.