about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-08-21 18:15:01 +0200
committerGitHub <noreply@github.com>2024-08-21 18:15:01 +0200
commit48c9864a0561fca29ce5c26535abd81cbe612097 (patch)
treed0db5acc5e468b42a7b9a86d42ce6fdbcd15b9ad /compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
parentdea325e583adfcb9fec771da547dc304e79a5ee2 (diff)
parent1350a65736d66ff771010442258c1cbf499b1842 (diff)
downloadrust-48c9864a0561fca29ce5c26535abd81cbe612097.tar.gz
rust-48c9864a0561fca29ce5c26535abd81cbe612097.zip
Rollup merge of #128843 - veera-sivarajan:small-cleanup, r=davidtwco
Minor Refactor: Remove a Redundant Conditional Check

The existing code checks `where_bounds.is_empty()` twice when
it can be combined into one. Now, after combining, the refactored code reads
better and feels straightforward.

The diff doesn't make it clear. So, the current code looks like this:
``` rust
    if !where_bounds.is_empty() {
        err.help(format!(
            "consider introducing a new type parameter `T` and adding `where` constraints:\
             \n    where\n        T: {qself_str},\n{}",
            where_bounds.join(",\n"),
        ));
    }
    let reported = err.emit();
    if !where_bounds.is_empty() {
        return Err(reported);
    }
```
The proposed changes:
``` rust
    if !where_bounds.is_empty() {
        err.help(format!(
            "consider introducing a new type parameter `T` and adding `where` constraints:\
             \n    where\n        T: {qself_str},\n{}",
            where_bounds.join(",\n"),
        ));
        let reported = err.emit();
        return Err(reported);
    }
    err.emit();

```
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp')
0 files changed, 0 insertions, 0 deletions