Rollup merge of #82367 - matthiaskrgr:wraps, r=petrochenkov
remove redundant option/result wrapping of return values If a function always returns `Ok(something)`, we can return `something` directly and remove the corresponding error handling in the callers. clippy::unnecessary_wraps
This commit is contained in:
commit
1870b3bac6
10 changed files with 30 additions and 46 deletions
|
@ -735,7 +735,7 @@ fn execute_work_item<B: ExtraBackendMethods>(
|
|||
match work_item {
|
||||
WorkItem::Optimize(module) => execute_optimize_work_item(cgcx, module, module_config),
|
||||
WorkItem::CopyPostLtoArtifacts(module) => {
|
||||
execute_copy_from_cache_work_item(cgcx, module, module_config)
|
||||
Ok(execute_copy_from_cache_work_item(cgcx, module, module_config))
|
||||
}
|
||||
WorkItem::LTO(module) => execute_lto_work_item(cgcx, module, module_config),
|
||||
}
|
||||
|
@ -844,7 +844,7 @@ fn execute_copy_from_cache_work_item<B: ExtraBackendMethods>(
|
|||
cgcx: &CodegenContext<B>,
|
||||
module: CachedModuleCodegen,
|
||||
module_config: &ModuleConfig,
|
||||
) -> Result<WorkItemResult<B>, FatalError> {
|
||||
) -> WorkItemResult<B> {
|
||||
let incr_comp_session_dir = cgcx.incr_comp_session_dir.as_ref().unwrap();
|
||||
let mut object = None;
|
||||
if let Some(saved_file) = module.source.saved_file {
|
||||
|
@ -870,13 +870,13 @@ fn execute_copy_from_cache_work_item<B: ExtraBackendMethods>(
|
|||
|
||||
assert_eq!(object.is_some(), module_config.emit_obj != EmitObj::None);
|
||||
|
||||
Ok(WorkItemResult::Compiled(CompiledModule {
|
||||
WorkItemResult::Compiled(CompiledModule {
|
||||
name: module.name,
|
||||
kind: ModuleKind::Regular,
|
||||
object,
|
||||
dwarf_object: None,
|
||||
bytecode: None,
|
||||
}))
|
||||
})
|
||||
}
|
||||
|
||||
fn execute_lto_work_item<B: ExtraBackendMethods>(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue