 (defcustom rust-indent-offset 4
   "Indent Rust code by this number of spaces."
   :type 'integer
+  :group 'rust-mode)
+
+(defcustom rust-indent-method-chain nil
+  "Indent Rust method chains, aligned by the '.' operators"
+  :type 'boolean
   :group 'rust-mode)
 
 (defun rust-paren-level () (nth 0 (syntax-ppss)))

                   ;; the inside of it correctly relative to the outside.
                   (if (= 0 level)
                       0
                     (save-excursion
                       (backward-up-list)
                       (rust-rewind-to-beginning-of-current-level-expr)
                       (+ (current-column) rust-indent-offset)))))
             (cond
              ;; A function return type is indented to the corresponding function arguments
              ((looking-at "->")

              ;; A closing brace is 1 level unindended
              ((looking-at "}") (- baseline rust-indent-offset))

              ;;Line up method chains by their .'s
              ((when (and rust-indent-method-chain
                          (looking-at "\..+\(.*\);?\n"))
                 (or
                  (let ((method-indent (rust-align-to-method-chain)))
                    (when method-indent
                      (+ method-indent rust-indent-offset)))
                  (+ baseline rust-indent-offset))))

              
              ;; Doc comments in /** style with leading * indent to line up the *s
              ((and (nth 4 (syntax-ppss)) (looking-at "*"))
               (+ 1 baseline))
