 (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)))

              ;; A closing brace is 1 level unindended
              ((looking-at "}") (- 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))

	(forward-word 1)
	(backward-word 1))
      (current-column))))

(defun rust-align-to-method-chain ()
  (save-excursion
	(previous-line)
	(end-of-line)
	(backward-word 1)
	(backward-char)
	(when (looking-at "\\..+\(.*\)\n")
	  (- (current-column) rust-indent-offset))))

(defun rust-rewind-to-beginning-of-current-level-expr ()
  (let ((current-level (rust-paren-level)))
