(
state: &AppState,
function_name: String,
)
| 53 | } |
| 54 | |
| 55 | fn create_scratch_config( |
| 56 | state: &AppState, |
| 57 | function_name: String, |
| 58 | ) -> Result<create_scratch::CreateScratchConfig> { |
| 59 | let Some(selected_obj) = &state.config.selected_obj else { |
| 60 | bail!("No object selected"); |
| 61 | }; |
| 62 | let Some(target_path) = &selected_obj.target_path else { |
| 63 | bail!("No target path for {}", selected_obj.name); |
| 64 | }; |
| 65 | let Some(scratch_config) = &selected_obj.scratch else { |
| 66 | bail!("No scratch configuration for {}", selected_obj.name); |
| 67 | }; |
| 68 | Ok(create_scratch::CreateScratchConfig { |
| 69 | build_config: BuildConfig::from(&state.config), |
| 70 | context_path: scratch_config.ctx_path.clone(), |
| 71 | build_context: scratch_config.build_ctx.unwrap_or(false), |
| 72 | compiler: scratch_config.compiler.clone().unwrap_or_default(), |
| 73 | platform: scratch_config.platform.clone().unwrap_or_default(), |
| 74 | compiler_flags: scratch_config.c_flags.clone().unwrap_or_default(), |
| 75 | function_name, |
| 76 | target_obj: target_path.clone(), |
| 77 | preset_id: scratch_config.preset_id, |
| 78 | demangler: state.effective_diff_config().demangler, |
| 79 | }) |
| 80 | } |
| 81 | |
| 82 | impl From<&AppConfig> for BuildConfig { |
| 83 | fn from(config: &AppConfig) -> Self { |
no test coverage detected