]> git.proxmox.com Git - ui/proxmox-yew-comp.git/commitdiff
tfa add totp: return Html directly instead of binding it locally
authorShannon Sterz <s.sterz@proxmox.com>
Fri, 27 Dec 2024 14:28:53 +0000 (15:28 +0100)
committerShannon Sterz <s.sterz@proxmox.com>
Tue, 7 Jan 2025 09:08:29 +0000 (10:08 +0100)
this fixes the clippy ling `let_and_return` [1].

[1]: https://rust-lang.github.io/rust-clippy/master/#let_and_return

src/tfa/tfa_add_totp.rs

index 7e618b027cac9d5a11ef6ad3a7675f9e1feebd58..2c8b839d7ac912fdb2f2fb73090410e239427a8e 100644 (file)
@@ -196,8 +196,8 @@ fn validate_secret(secret: &String) -> Result<(), Error> {
 fn render_qrcode(text: &str) -> Html {
     let code = qrcode::QrCode::new(text).unwrap();
     let svg_xml = code.render::<qrcode::render::svg::Color>().build();
-    let parsed = Html::from_html_unchecked(AttrValue::from(svg_xml));
-    parsed
+
+    Html::from_html_unchecked(AttrValue::from(svg_xml))
 }
 
 fn randomize_secret() -> String {