MCPcopy Index your code
hub / github.com/cargo-lambda/cargo-lambda / get_template

Function get_template

crates/cargo-lambda-new/src/lib.rs:194–215  ·  view source on GitHub ↗
(config: &Config)

Source from the content-addressed store, hash-verified

192}
193
194async fn get_template(config: &Config) -> Result<TemplateRoot> {
195 let progress = Progress::start("downloading template");
196
197 let template_option = match config.template.as_deref() {
198 Some(t) => t,
199 None if config.extension => extensions::DEFAULT_TEMPLATE_URL,
200 None => functions::DEFAULT_TEMPLATE_URL,
201 };
202
203 let template_source = TemplateSource::try_from(template_option);
204 match template_source {
205 Ok(ts) => {
206 let result = ts.expand().await;
207 progress.finish_and_clear();
208 result
209 }
210 Err(e) => {
211 progress.finish_and_clear();
212 Err(e)
213 }
214 }
215}
216
217#[tracing::instrument(target = "cargo_lambda")]
218async fn create_project<T: AsRef<Path> + Debug>(

Callers 1

new_projectFunction · 0.85

Calls 2

expandMethod · 0.80
finish_and_clearMethod · 0.80

Tested by

no test coverage detected