Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/cargo/ops/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
))
Expand All @@ -439,7 +439,7 @@ pub fn search(query: &str,
Some(desc) => {
let space = repeat(' ').take(description_margin - name.len())
.collect::<String>();
name + &space + &desc
name + &space + "# " + &desc
}
None => name
};
Expand Down
4 changes: 2 additions & 2 deletions tests/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down