Skip to content

Commit

Permalink
doc: use await in filehandle.truncate() snippet
Browse files Browse the repository at this point in the history
The example snippet of filehandle.close() uses the `await` keyword
based on convention. This change updates the example snippet of
filehandle.truncate() to similarly use the keyword for the purposes of
consistency.

PR-URL: #38939
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
  • Loading branch information
RA80533 authored and targos committed Sep 4, 2021
1 parent e7f3f0d commit f799c46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ try {
filehandle = await open('temp.txt', 'r+');
await filehandle.truncate(4);
} finally {
filehandle?.close();
await filehandle?.close();
}
```
Expand Down

0 comments on commit f799c46

Please sign in to comment.