Rust 字符串插值 All In One


Rust 字符串插值 All In One

extern crate wasm_bindgen;

use wasm_bindgen::prelude::*;

#[wasm_bindgen]
extern {
  pub fn alert(s: &str);
}

#[wasm_bindgen]
pub fn greet(name: &str) {
  // Rust 字符串插值
  alert(&format!("Hello, {}!", name));
}


// fn 定义 function
fn add(left: usize, right: usize) -> usize {
// {} 插值,占位符
println!("/n

原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/288871.html

(0)
上一篇 2022年9月11日 23:22
下一篇 2022年9月11日 23:22

相关推荐

发表回复

登录后才能评论