diff options
| author | topecongiro <seuchida@gmail.com> | 2017-10-05 20:50:19 +0900 |
|---|---|---|
| committer | topecongiro <seuchida@gmail.com> | 2017-10-05 20:50:19 +0900 |
| commit | fe69dde96be4b7afcef4975e825d385b23b51799 (patch) | |
| tree | 0f3fbd50eeaf537753c313df938e7edc3141c40e /src/string.rs | |
| parent | 69ab2b5f5e3ebb3bdcd07c8de12d2604ce2981a2 (diff) | |
Replace 'try_opt!' macro with a '?' operator
Diffstat (limited to 'src/string.rs')
| -rw-r--r-- | src/string.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/string.rs b/src/string.rs index efec7ff2377..c072d3186a2 100644 --- a/src/string.rs +++ b/src/string.rs @@ -67,7 +67,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 = 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. |
