MCPcopy Create free account
hub / github.com/PerroEngine/Perro / rewrite_markdown_links

Function rewrite_markdown_links

perro_website/build.rs:285–302  ·  view source on GitHub ↗
(collection: &str, slug: &str, markdown: &str)

Source from the content-addressed store, hash-verified

283 output_dir
284 } else if bundle_complete(public_dir) {
285 public_dir
286 } else {
287 return Ok(true);
288 };
289
290 let Some(output_time) = newest_mtime(reference_dir)? else {
291 return Ok(true);
292 };
293 let Some(input_time) = newest_demo_input_mtime(project_root)? else {
294 return Ok(false);
295 };
296 Ok(input_time > output_time)
297}
298
299fn newest_demo_input_mtime(project_root: &Path) -> io::Result<Option<SystemTime>> {
300 let mut newest = fs::metadata(project_root.join("project.toml"))
301 .and_then(|meta| meta.modified())
302 .ok();
303 for child in ["res", "src", "docs", "deps.toml", "routes.toml"] {
304 let path = project_root.join(child);
305 if let Some(time) = newest_mtime(&path)? {

Callers 1

push_docFunction · 0.85

Calls 4

rewrite_link_targetFunction · 0.85
findMethod · 0.80
lenMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected