From 622124f9408f3e4044e40f8104436ae05ebcd87d Mon Sep 17 00:00:00 2001 From: Esteban Borai Date: Sun, 4 Sep 2022 14:46:50 -0400 Subject: [PATCH 1/4] fix: specifies the max length for crate name Provides the maximum length on the crate name as is defined in the [crate's validation source code from crates.io][1]. [1]: https://github.com/rust-lang/crates.io/blob/3fc08ba57e782cff422a2f92503f09287d1a5140/src/models/krate.rs#L74 --- src/doc/src/reference/manifest.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/doc/src/reference/manifest.md b/src/doc/src/reference/manifest.md index e239042dcfc..de756f09dcb 100644 --- a/src/doc/src/reference/manifest.md +++ b/src/doc/src/reference/manifest.md @@ -73,7 +73,8 @@ The package name is an identifier used to refer to the package. It is used when listed as a dependency in another package, and as the default name of inferred lib and bin targets. -The name must use only [alphanumeric] characters or `-` or `_`, and cannot be empty. +The name must use only [alphanumeric] characters or `-` or `_`, and cannot be +empty, the maximum length for the crate name is 64 characters. Note that [`cargo new`] and [`cargo init`] impose some additional restrictions on the package name, such as enforcing that it is a valid Rust identifier and not a keyword. [crates.io] imposes even more restrictions, such as From 8913cbfc665f36394983a58eff8ba1968816c23c Mon Sep 17 00:00:00 2001 From: Esteban Borai Date: Sun, 4 Sep 2022 15:53:16 -0400 Subject: [PATCH 2/4] fix: list under restrictions --- src/doc/src/reference/manifest.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/doc/src/reference/manifest.md b/src/doc/src/reference/manifest.md index de756f09dcb..5a753600303 100644 --- a/src/doc/src/reference/manifest.md +++ b/src/doc/src/reference/manifest.md @@ -74,12 +74,16 @@ when listed as a dependency in another package, and as the default name of inferred lib and bin targets. The name must use only [alphanumeric] characters or `-` or `_`, and cannot be -empty, the maximum length for the crate name is 64 characters. +empty. + Note that [`cargo new`] and [`cargo init`] impose some additional restrictions on the package name, such as enforcing that it is a valid Rust identifier and not -a keyword. [crates.io] imposes even more restrictions, such as -enforcing only ASCII characters, not a reserved name, not a special Windows -name such as "nul", is not too long, etc. +a keyword. [crates.io] imposes even more restrictions, such as: + +- Only ASCII characters are allowed +- Do not use reserved names +- Do not use special Windows name such as "nul" +- Use a maximum of 64 characters of length [alphanumeric]: ../../std/primitive.char.html#method.is_alphanumeric From 1175ee81bff1b34b5b91b7ed087c63912e55fb2b Mon Sep 17 00:00:00 2001 From: Esteban Borai Date: Mon, 5 Sep 2022 21:57:30 -0300 Subject: [PATCH 3/4] fix: add periods to list items Co-authored-by: Weihang Lo --- src/doc/src/reference/manifest.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/doc/src/reference/manifest.md b/src/doc/src/reference/manifest.md index 5a753600303..636d6058971 100644 --- a/src/doc/src/reference/manifest.md +++ b/src/doc/src/reference/manifest.md @@ -80,10 +80,10 @@ Note that [`cargo new`] and [`cargo init`] impose some additional restrictions o the package name, such as enforcing that it is a valid Rust identifier and not a keyword. [crates.io] imposes even more restrictions, such as: -- Only ASCII characters are allowed -- Do not use reserved names -- Do not use special Windows name such as "nul" -- Use a maximum of 64 characters of length +- Only ASCII characters are allowed. +- Do not use reserved names. +- Do not use special Windows name such as "nul". +- Use a maximum of 64 characters of length. [alphanumeric]: ../../std/primitive.char.html#method.is_alphanumeric From 98ccc09eb5508ae0f00158154bfb29318c68b6af Mon Sep 17 00:00:00 2001 From: Esteban Borai Date: Mon, 5 Sep 2022 21:01:56 -0400 Subject: [PATCH 4/4] fix: remove wrapping for sentence --- src/doc/src/reference/manifest.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/doc/src/reference/manifest.md b/src/doc/src/reference/manifest.md index 636d6058971..47aa6b82429 100644 --- a/src/doc/src/reference/manifest.md +++ b/src/doc/src/reference/manifest.md @@ -73,8 +73,7 @@ The package name is an identifier used to refer to the package. It is used when listed as a dependency in another package, and as the default name of inferred lib and bin targets. -The name must use only [alphanumeric] characters or `-` or `_`, and cannot be -empty. +The name must use only [alphanumeric] characters or `-` or `_`, and cannot be empty. Note that [`cargo new`] and [`cargo init`] impose some additional restrictions on the package name, such as enforcing that it is a valid Rust identifier and not