write() reported Ok(partial) and Err from the same call, which Write forbids. Defer the error to the following call so write_all observes a genuine short write, then a failure — matching what a real fd does. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>