api-guidelines icon indicating copy to clipboard operation
api-guidelines copied to clipboard

Rust API guidelines

Results 39 api-guidelines issues
Sort by recently updated
recently updated
newest added

Per [RFC 3052](https://rust-lang.github.io/rfcs/3052-optional-authors-field.html), the `authors` field in `Cargo.toml` is now optional, and this fact should be [widely communicated](https://github.com/rust-lang/rfcs/pull/3052#issuecomment-768562315). See also: * https://github.com/rust-lang/rfcs/pull/3052 * https://github.com/rust-lang/rust/issues/83227

Current text recommends naming lifetime parameter with single letter too much. I've seen this adds a lot to beginner's confusion. Change the order to stop encouraging that. Also, added discouraging...

The previous text only discussed raw pointers, but trait objects are another common situation where authors may accidentally design overly restrictive APIs, so I think that discussing them here is...

The [C-CTOR ](https://rust-lang.github.io/api-guidelines/predictability.html#constructors-are-static-inherent-methods-c-ctor)guideline states: > Constructors are static, inherent methods (C-CCTOR) > ... > Constructors are static (no self) inherent methods for the type that they construct... However, this is...

Corrected what I believe to be copy-pasta in the C-CALLER-CONTROL guideline.

In [RFC344](https://github.com/rust-lang/rfcs/blob/master/text/0344-conventions-galore.md?plain=1#L172-L173), setter is described as: ```markdown * A method `set_foo(&self, val: T)` for setting the field. (The `val` argument here may take `&T` or some other type, depending on...

```diff * Apache License, Version 2.0 - ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) + ([LICENSE-APACHE](LICENSE-APACHE) or ) * MIT license - ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) + ([LICENSE-MIT](LICENSE-MIT) or ) ``` This is done so...

The document says everything should be documented, but does not reference the lint rule helping with it.