diff options
| author | topecongiro <seuchida@gmail.com> | 2017-05-03 11:26:25 +0900 |
|---|---|---|
| committer | topecongiro <seuchida@gmail.com> | 2017-05-03 11:26:25 +0900 |
| commit | f5da9d779fd0e72c97823eb808e13d44ebad86fb (patch) | |
| tree | 9bdf015f9dcc8a019542ee0b8a4f40adbeb59bbb /src/string.rs | |
| parent | e91d498b8f771ed9ddc1abbedf4d261883d4d505 (diff) | |
Format source codes
Diffstat (limited to 'src/string.rs')
| -rw-r--r-- | src/string.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/string.rs b/src/string.rs index e1e0681ba56..37a569ce67d 100644 --- a/src/string.rs +++ b/src/string.rs @@ -51,10 +51,7 @@ pub fn rewrite_string<'a>(orig: &str, fmt: &StringFormat<'a>) -> Option<String> let ender_length = fmt.line_end.len(); // If we cannot put at least a single character per line, the rewrite won't // succeed. - let max_chars = try_opt!(shape - .width - .checked_sub(fmt.opener.len() + ender_length + 1)) + - 1; + let max_chars = try_opt!(shape.width.checked_sub(fmt.opener.len() + ender_length + 1)) + 1; // Snip a line at a time from `orig` until it is used up. Push the snippet // onto result. |
