]> git.lizzy.rs Git - rust.git/commitdiff
Use correct width for subexpr_list
authortopecongiro <seuchida@gmail.com>
Sun, 13 Aug 2017 01:17:52 +0000 (10:17 +0900)
committertopecongiro <seuchida@gmail.com>
Sun, 13 Aug 2017 01:17:52 +0000 (10:17 +0900)
src/chains.rs
tests/source/expr-block.rs
tests/target/expr-block.rs

index 75dac5b322762c8405f0559e0b6cad1c109b1ff8..9c129ef99eed4e0530a88d1619f50b1303834ca6 100644 (file)
@@ -233,6 +233,7 @@ pub fn rewrite_chain(expr: &ast::Expr, context: &RewriteContext, shape: Shape) -
         connector.as_str()
     };
 
+    let subexpr_num = subexpr_list.len();
     let result = if is_small_parent && rewrites.len() > 1 {
         let second_connector = choose_first_connector(
             context,
index 3b4e6356ff9031aa089eef396a6ece7dea479819..1d55bd0a0d9192afe7da2508625693eb83a69c93 100644 (file)
@@ -282,3 +282,7 @@ fn issue_1862() {
         /* com */ this_last_arg_is_tooooooooooooooooooooooooooooooooo_long_to_be_kept_with_the_pre_comment ,
     )
 }
+
+fn issue_1878() {
+    let channel: &str = seq.next_element()?.ok_or_else(|| de::Error::invalid_length(2, &self))?;
+}
index 68c5421c3ca26b8cd1061236eb4a73aba73d4c67..194798ff472718c6ccdfbdbcfc2a8c066d0c99ea 100644 (file)
@@ -333,3 +333,8 @@ fn issue_1862() {
         this_last_arg_is_tooooooooooooooooooooooooooooooooo_long_to_be_kept_with_the_pre_comment,
     )
 }
+
+fn issue_1878() {
+    let channel: &str = seq.next_element()?
+        .ok_or_else(|| de::Error::invalid_length(2, &self))?;
+}