From fae53197dbeeb8c48ba4556805e4af849b6704d2 Mon Sep 17 00:00:00 2001 From: rambip Date: Thu, 23 Nov 2023 21:36:18 +0100 Subject: [PATCH] use new api --- Cargo.lock | 2 +- src/lib.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6b4a688..d131873 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -940,7 +940,7 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "rust-web-markdown" version = "0.1.0" -source = "git+https://github.com/rambip/rust-web-markdown/#3233043d37061038c962aba2fd97de7b526bf4ca" +source = "git+https://github.com/rambip/rust-web-markdown/#1feae2ef60c850967f6edcb9d0dd468e1082966d" dependencies = [ "katex", "lazy_static", diff --git a/src/lib.rs b/src/lib.rs index 70ba7c3..50a9e20 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -15,16 +15,16 @@ use web_sys::{window, MouseEvent}; use std::collections::HashMap; -impl Context<'static> for Props { +impl<'a> Context<'a, 'static> for &'a Props { type View = Html; type HtmlCallback = Callback; type Handler = Callback; - type Setter = UseStateHandle; + type Setter = UseStateHandle; - fn props<'a>(&'a self) -> MarkdownProps<'a, 'static, Self> { + fn props(&'a self) -> MarkdownProps<'a, 'static, Self> { let Props { onclick, render_links, @@ -246,5 +246,5 @@ pub struct Props { #[function_component] pub fn Markdown(props: &Props) -> Html { - render_markdown(props, &props.src) + render_markdown(&props, &props.src) }