# all: prefer \`else =\> \|e\| return e,\` over \`else =\> return err,\` · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/6e35138901d052f19d41ec7bafeaf31f1adf54f6)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 6e35138901d052f19d41ec7bafeaf31f1adf54f6

Requested commit: 6e35138901d052f19d41ec7bafeaf31f1adf54f6

Commit: 6e35138901d052f19d41ec7bafeaf31f1adf54f6

Tree: a3a8badf0dc4394602abaaf2199572158f5adc17

Author: Justus Klausecker

Committer: Matthew Lugg

## Message

```
all: prefer `else => |e| return e,` over `else => return err,`

When switching on an error, using the captured value instead of the original
one is always preferable since its error set has been narrowed to only
contain errors which haven't already been handled by other switch prongs.

The subsequent commits will disallow this form as an unreachable `else` prong.

```

## Parents

- [9e949f95c15a7552f84209e01a78b5e0d12225db](https://git.cafe/gitcafe/zig/commit/9e949f95c15a7552f84209e01a78b5e0d12225db?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/6e35138901d052f19d41ec7bafeaf31f1adf54f6?format=markdown)
