ariadne icon indicating copy to clipboard operation
ariadne copied to clipboard

Reports with non-static labels

Open NViviers opened this issue 2 years ago • 0 comments

New to this crate, so not sure if I'm simply doing something wrong but it seems like you can't build reports with non-static values:

Report::build(ReportKind::Error, ...)
    .with_message(...)
    with_label(Label::new((data.file.as_str(), span)))

data.file is a String instance, my main function calls another function passing data which then builds the report. Borrowed data either escapes the function body or doesn't outlive 'static as required

NViviers avatar Nov 30 '22 18:11 NViviers