diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-01-22 12:42:55 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-22 12:42:55 +0000 |
| commit | eba97564580db2531d8dbc0707c39b60ae506ded (patch) | |
| tree | 8f7f083cba15a693fc944e0f40a171fa72e6bb5b /docs/dev | |
| parent | 1b96c79ab5bb3eae373e3392695d3578ed4bbf59 (diff) | |
| parent | 4c92ef03acc5dc983a4ed6c587257e396ef507c0 (diff) | |
| download | rust-eba97564580db2531d8dbc0707c39b60ae506ded.tar.gz rust-eba97564580db2531d8dbc0707c39b60ae506ded.zip | |
Merge #7390
7390: Style: use the right string r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Diffstat (limited to 'docs/dev')
| -rw-r--r-- | docs/dev/style.md | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/docs/dev/style.md b/docs/dev/style.md index 3896493980b..7e6cd49e07f 100644 --- a/docs/dev/style.md +++ b/docs/dev/style.md @@ -6,6 +6,9 @@ Our approach to "clean code" is two-fold: It is explicitly OK for a reviewer to flag only some nits in the PR, and then send a follow-up cleanup PR for things which are easier to explain by example, cc-ing the original author. Sending small cleanup PRs (like renaming a single local variable) is encouraged. +When reviewing pull requests prefer extending this document to leaving +non-reusable comments on the pull request itself. + # General ## Scale of Changes @@ -375,6 +378,15 @@ This allows for exceptionally good performance, but leads to increased compile t Runtime performance obeys 80%/20% rule -- only a small fraction of code is hot. Compile time **does not** obey this rule -- all code has to be compiled. +## Appropriate String Types + +When interfacing with OS APIs, use `OsString`, even if the original source of +data is utf-8 encoded. **Rationale:** cleanly delineates the boundary when the +data goes into the OS-land. + +Use `AbsPathBuf` and `AbsPath` over `std::Path`. **Rationale:** rust-analyzer is +a long-lived process which handles several projects at the same time. It is +important not to leak cwd by accident. # Premature Pessimization |
