# std.Io\.\{Writer\|Duration\}: move duration formatting to a format method · gitcafe/zig

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

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

Visibility: public

Requested revision: 99229ceb55be717aa1995f1a0105bc6b96a910f6

Requested commit: 99229ceb55be717aa1995f1a0105bc6b96a910f6

Commit: 99229ceb55be717aa1995f1a0105bc6b96a910f6

Tree: fa3d122d0d429fd002e097d553de0c508267b764

Author: hemisputnik

Committer: Andrew Kelley

## Message

````
std.Io.{Writer|Duration}: move duration formatting to a format method

Remove the `{D}` format specifier. It is moved into `std.Io.Duration` as
a format method.

Migration plan:

```diff
-writer.print("{D}", .{ns});
+writer.print("{f}", .{std.Io.Duration{ .nanoseconds = ns }});
```

All instances where `{D}` was used have been changed to use
`std.Io.Duration` and `{f}`.

Fixes #31281

````

## Parents

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

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