wasmtime-wit-bindgen 25.0.1
“Internal `*.wit` support for the `wasmtime` crate's macros”
Contains an unbounded block loopConstructs a Rust child-process command
SHA-256eb1596caa67b31ac675fd3da61685c4260f8b10832021db42c85d227b7ba8133
MaleculeH₂(DbPo₂)Md(Pa)
Evidence
1use crate::rust::{to_rust_ident, to_rust_upper_camel_case, RustGenerator, TypeMode};
2use crate::types::{TypeInfo, Types};
3use anyhow::bail;
4use heck::*;
5use indexmap::{IndexMap, IndexSet};
6use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
7use std::fmt::Write as _;
8use std::io::{Read, Write};
9use std::mem;
10use std::process::{Command, Stdio};
11use wit_parser::*;
12
13macro_rules! uwrite {
⋯6 lines
1074:44… rc);
1075 if self.opts.rustfmt {
1076 let mut child = Command::new("rustfmt")
1077 .arg("--edition=2018")
1078 .stdin(Stdio::piped())
1079 .stdout(Stdio::piped())
1080 …
1084:4… .take()
1085 .unwrap()
1086 .write_all(src.as_bytes())
1087 .unwrap();
1088 src.as_mut_string().truncate(0);
1089 child
1090 .stdou …
1225:4… let mut projection = Vec::new();
1226 let mut ret = Vec::new();
1227 loop {
1228 let lookup = name.lookup_key(resolve);
1229 ret.push((lookup, projection.clone()));
1230 if !name.pop(resolve, &m …
⋯4 lines
79}
80
81#[cfg(test)]
82mod tests {
83 use super::Source;
84
85 #[test]
86 fn simple_append() {
87 let mut s = Source::default();
88 s.push_str("x");
89 assert_eq!(s.s, "x");
90 s.push_str("y");
91 assert_eq!(s.s, "xy");
92 s.push_str("z ");
93 …
No evidence locations were recorded for this file. Raw result