diff --git a/src/cargo/ops/registry.rs b/src/cargo/ops/registry.rs index 5d35b71e3b7..447c19f282f 100644 --- a/src/cargo/ops/registry.rs +++ b/src/cargo/ops/registry.rs @@ -424,7 +424,7 @@ pub fn search(query: &str, let list_items = crates.iter() .map(|krate| ( - format!("{} ({})", krate.name, krate.max_version), + format!("{} = \"{}\"", krate.name, krate.max_version), krate.description.as_ref().map(|desc| truncate_with_ellipsis(&desc.replace("\n", " "), 128)) )) @@ -439,7 +439,7 @@ pub fn search(query: &str, Some(desc) => { let space = repeat(' ').take(description_margin - name.len()) .collect::(); - name + &space + &desc + name + &space + "# " + &desc } None => name }; diff --git a/tests/search.rs b/tests/search.rs index b2f1c8ad1bc..4c55058ade5 100644 --- a/tests/search.rs +++ b/tests/search.rs @@ -87,7 +87,7 @@ fn simple() { .with_stderr("\ [UPDATING] registry `[..]`") .with_stdout("\ -hoare (0.1.1) Design by contract style assertions for Rust")); +hoare = \"0.1.1\" # Design by contract style assertions for Rust")); } #[test] @@ -139,7 +139,7 @@ fn multiple_query_params() { .with_stderr("\ [UPDATING] registry `[..]`") .with_stdout("\ -hoare (0.1.1) Design by contract style assertions for Rust")); +hoare = \"0.1.1\" # Design by contract style assertions for Rust")); } #[test]