actr_cli/templates/rust/
echo.rs

1use crate::error::Result;
2use crate::templates::ProjectTemplate;
3use std::collections::HashMap;
4use std::path::Path;
5
6pub fn load(files: &mut HashMap<String, String>) -> Result<()> {
7    let fixtures_root = Path::new(env!("CARGO_MANIFEST_DIR")).join("fixtures");
8
9    // Cargo.toml
10    ProjectTemplate::load_file(
11        &fixtures_root.join("rust/Cargo.toml.hbs"),
12        files,
13        "Cargo.toml",
14    )?;
15
16    // src/lib.rs
17    ProjectTemplate::load_file(&fixtures_root.join("rust/lib.rs.hbs"), files, "src/lib.rs")?;
18
19    // Actr.toml
20    ProjectTemplate::load_file(
21        &fixtures_root.join("rust/Actr.toml.hbs"),
22        files,
23        "Actr.toml",
24    )?;
25
26    // proto/echo.proto
27    ProjectTemplate::load_file(
28        &fixtures_root.join("echo-service/echo.proto"),
29        files,
30        "protos/echo.proto",
31    )?;
32
33    // build.rs
34    ProjectTemplate::load_file(&fixtures_root.join("rust/build.rs.hbs"), files, "build.rs")?;
35
36    // README.md
37    ProjectTemplate::load_file(
38        &fixtures_root.join("rust/README.md.hbs"),
39        files,
40        "README.md",
41    )?;
42
43    // .gitignore
44    ProjectTemplate::load_file(
45        &fixtures_root.join("rust/gitignore.hbs"),
46        files,
47        ".gitignore",
48    )?;
49
50    Ok(())
51}