mirror of
https://github.com/typst/typst
synced 2025-05-23 13:35:28 +08:00
Remove unnecessary 'static bounds
This commit is contained in:
parent
c8ebcd70d6
commit
2fd0291a81
@ -27,7 +27,7 @@ use crate::World;
|
|||||||
/// When `explicit` is `true`, the user requested the completion by pressing
|
/// When `explicit` is `true`, the user requested the completion by pressing
|
||||||
/// control and space or something similar.
|
/// control and space or something similar.
|
||||||
pub fn autocomplete(
|
pub fn autocomplete(
|
||||||
world: &(dyn World + 'static),
|
world: &dyn World,
|
||||||
frames: &[Frame],
|
frames: &[Frame],
|
||||||
source: &Source,
|
source: &Source,
|
||||||
cursor: usize,
|
cursor: usize,
|
||||||
@ -944,7 +944,7 @@ fn code_completions(ctx: &mut CompletionContext, hashtag: bool) {
|
|||||||
|
|
||||||
/// Context for autocompletion.
|
/// Context for autocompletion.
|
||||||
struct CompletionContext<'a> {
|
struct CompletionContext<'a> {
|
||||||
world: &'a (dyn World + 'static),
|
world: &'a (dyn World + 'a),
|
||||||
frames: &'a [Frame],
|
frames: &'a [Frame],
|
||||||
library: &'a Library,
|
library: &'a Library,
|
||||||
global: &'a Scope,
|
global: &'a Scope,
|
||||||
@ -963,7 +963,7 @@ struct CompletionContext<'a> {
|
|||||||
impl<'a> CompletionContext<'a> {
|
impl<'a> CompletionContext<'a> {
|
||||||
/// Create a new autocompletion context.
|
/// Create a new autocompletion context.
|
||||||
fn new(
|
fn new(
|
||||||
world: &'a (dyn World + 'static),
|
world: &'a (dyn World + 'a),
|
||||||
frames: &'a [Frame],
|
frames: &'a [Frame],
|
||||||
source: &'a Source,
|
source: &'a Source,
|
||||||
cursor: usize,
|
cursor: usize,
|
||||||
|
@ -16,7 +16,7 @@ use crate::World;
|
|||||||
|
|
||||||
/// Describe the item under the cursor.
|
/// Describe the item under the cursor.
|
||||||
pub fn tooltip(
|
pub fn tooltip(
|
||||||
world: &(dyn World + 'static),
|
world: &dyn World,
|
||||||
frames: &[Frame],
|
frames: &[Frame],
|
||||||
source: &Source,
|
source: &Source,
|
||||||
cursor: usize,
|
cursor: usize,
|
||||||
@ -43,7 +43,7 @@ pub enum Tooltip {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Tooltip for a hovered expression.
|
/// 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;
|
let mut ancestor = leaf;
|
||||||
while !ancestor.is::<ast::Expr>() {
|
while !ancestor.is::<ast::Expr>() {
|
||||||
ancestor = ancestor.parent()?;
|
ancestor = ancestor.parent()?;
|
||||||
@ -143,7 +143,7 @@ fn length_tooltip(length: Length) -> Option<Tooltip> {
|
|||||||
|
|
||||||
/// Tooltip for a hovered reference.
|
/// Tooltip for a hovered reference.
|
||||||
fn ref_tooltip(
|
fn ref_tooltip(
|
||||||
world: &(dyn World + 'static),
|
world: &dyn World,
|
||||||
frames: &[Frame],
|
frames: &[Frame],
|
||||||
leaf: &LinkedNode,
|
leaf: &LinkedNode,
|
||||||
) -> Option<Tooltip> {
|
) -> Option<Tooltip> {
|
||||||
@ -162,10 +162,7 @@ fn ref_tooltip(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Tooltips for components of a named parameter.
|
/// Tooltips for components of a named parameter.
|
||||||
fn named_param_tooltip(
|
fn named_param_tooltip(world: &dyn World, leaf: &LinkedNode) -> Option<Tooltip> {
|
||||||
world: &(dyn World + 'static),
|
|
||||||
leaf: &LinkedNode,
|
|
||||||
) -> Option<Tooltip> {
|
|
||||||
let (func, named) = if_chain! {
|
let (func, named) = if_chain! {
|
||||||
// Ensure that we are in a named pair in the arguments to a function
|
// Ensure that we are in a named pair in the arguments to a function
|
||||||
// call or set rule.
|
// call or set rule.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user