Skip to content

Commit

Permalink
Fix crash when listing custom instruments
Browse files Browse the repository at this point in the history
- closes cmyr#14
  • Loading branch information
cmyr committed Feb 24, 2020
1 parent fbfea59 commit 7201328
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cargo-instruments"
version = "0.3.0"
version = "0.3.1"
authors = ["Colin Rofls <[email protected]>"]
license = "MIT"
description = "Generate Xcode Instruments trace files for binary targets."
Expand Down
2 changes: 1 addition & 1 deletion src/instruments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub(crate) fn list() -> Result<String, Error> {
output.push_str(name);
if let Some(abbrv) = abbrv {
let some_spaces = " ";
let lpad = max_width - name.len();
let lpad = (max_width - name.len()).min(some_spaces.len());
output.push_str(&some_spaces[..lpad]);
output.push_str(&format!("({})", abbrv));
}
Expand Down

0 comments on commit 7201328

Please sign in to comment.