# remote_server: Remove unnecessary Box, prevent time-of-check time-of-use bug \(\#24730\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/5d634245a2a6547a7d1dc4a3fcea768c0dff4e20)

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

Visibility: public

Requested revision: 5d634245a2a6547a7d1dc4a3fcea768c0dff4e20

Requested commit: 5d634245a2a6547a7d1dc4a3fcea768c0dff4e20

Commit: 5d634245a2a6547a7d1dc4a3fcea768c0dff4e20

Tree: 49f84e9645559ef781b0d4af545761fb325d54dd

Author: tidely

Committer: GitHub

## Message

```
remote_server: Remove unnecessary Box, prevent time-of-check time-of-use bug (#24730)

The MultiWrite struct is defined in the function scope and is allowed to
have a concrete type, which means we can throw away the extra Box.
PathBuf::exists is known to be prone to invalid usage. It doesn't take
into account permissions errors and just returns false, additionally it
introduces a time-of-check time-of-use bug. While extremely unlikely,
why not fix it anyway.

Release Notes:

- remove unnecessary Box
- prevent time-of-check time-of-use bug
```

## Parents

- [21a1541a70cae41a156cdf2a1ae964cce0054c20](https://git.cafe/gitcafe/zed/commit/21a1541a70cae41a156cdf2a1ae964cce0054c20?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/5d634245a2a6547a7d1dc4a3fcea768c0dff4e20?format=markdown)
