Open
Description
Hi!
I really like what rustfmt
is doing, however, one thing hurts me strongly here. It allows the vertical alignment of struct fields, but does not allow for such alignment of let bindings. Consider the following code:
impl Scene {
fn new() -> Result<Scene, Error> {
let doc = document()?;
let canvas = doc.get_element_by_id("canvas").ok_or(DOMError::missing("canvas"))?;
let data = Rc::new(SceneData { canvas, context });
let data_weak = Rc::downgrade(&data);
....
}
}
I believe it is much nicer to read the following code:
impl Scene {
fn new() -> Result<Scene, Error> {
let doc = document()?;
let canvas = doc.get_element_by_id("canvas").ok_or(DOMError::missing("canvas"))?;
let data = Rc::new(SceneData { canvas, context });
let data_weak = Rc::downgrade(&data);
....
}
}
Would it be possible to add some treshold option to rustfmt for such a style? :)