mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-24 14:28:42 +00:00
Improve UI orompt for installation (#1950)
Fixed #1943 The UI now looks like ``` WARN The package cargo-binstall v1.10.9 (aarch64-apple-darwin) has been downloaded from github.com INFO This will install the following binaries: INFO - cargo-binstall => /tmp/e/bin/cargo-binstall ```` Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
48f8cf9b86
commit
a944df0498
1 changed files with 12 additions and 2 deletions
|
@ -180,9 +180,19 @@ impl BinFile {
|
|||
}
|
||||
|
||||
pub fn preview_bin(&self) -> impl fmt::Display + '_ {
|
||||
LazyFormat {
|
||||
struct PreviewBin<'a> {
|
||||
base_name: &'a str,
|
||||
dest: path::Display<'a>,
|
||||
}
|
||||
|
||||
impl fmt::Display for PreviewBin<'_> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "{} => {}", self.base_name, self.dest)
|
||||
}
|
||||
}
|
||||
|
||||
PreviewBin {
|
||||
base_name: &self.base_name,
|
||||
source: Path::new(self.source.file_name().unwrap()).display(),
|
||||
dest: self.dest.display(),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue