Skip to content

Commit 4e792c2

Browse files
committed
Auto merge of #13202 - hi-rustin:rustin-patch-spec-example, r=weihanglo
refactor: give some better examples for package ID spec
2 parents c2408a7 + ad18dd0 commit 4e792c2

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

crates/cargo-util-schemas/src/core/package_id_spec.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,15 @@ impl PackageIdSpec {
6464
/// use cargo_util_schemas::core::PackageIdSpec;
6565
///
6666
/// let specs = vec![
67-
/// "https://crates.io/foo",
68-
/// "https://crates.io/foo#1.2.3",
69-
/// "https://crates.io/foo#bar:1.2.3",
70-
/// "https://crates.io/foo#[email protected]",
7167
/// "foo",
68+
69+
7270
/// "foo:1.2.3",
73-
71+
/// "https://github.com/rust-lang/crates.io-index#foo",
72+
/// "https://github.com/rust-lang/crates.io-index#[email protected]",
73+
/// "ssh://[email protected]/rust-lang/foo.git#[email protected]",
74+
/// "file:///path/to/my/project/foo",
75+
/// "file:///path/to/my/project/foo#1.1.8"
7476
/// ];
7577
/// for spec in specs {
7678
/// assert!(PackageIdSpec::parse(spec).is_ok());

0 commit comments

Comments
 (0)