MCPcopy Create free account
hub / github.com/bytecodealliance/wit-bindgen / print_docs

Method print_docs

crates/csharp/src/interface.rs:1326–1347  ·  view source on GitHub ↗
(&mut self, docs: &Docs)

Source from the content-addressed store, hash-verified

1324 }
1325
1326 fn print_docs(&mut self, docs: &Docs) {
1327 if let Some(docs) = &docs.contents {
1328 let lines = docs
1329 .trim()
1330 .replace("<", "&lt;")
1331 .replace(">", "&gt;")
1332 .replace("*/", "*") // We can't close the comment, so if the user comment has */ we just remove the /
1333 .lines()
1334 .map(|line| format!("* {line}"))
1335 .collect::<Vec<_>>()
1336 .join("\n");
1337
1338 uwrite!(
1339 self.src,
1340 "
1341 /**
1342 {lines}
1343 */
1344 "
1345 )
1346 }
1347 }
1348
1349 pub(crate) fn non_empty_type<'a>(&self, ty: Option<&'a Type>) -> Option<&'a Type> {
1350 if let Some(ty) = ty {

Callers 5

start_resourceMethod · 0.80
type_recordMethod · 0.80
type_flagsMethod · 0.80
type_variantMethod · 0.80
type_enumMethod · 0.80

Calls 2

joinMethod · 0.80
mapMethod · 0.80

Tested by

no test coverage detected