with_literal 1.0.0

With literal
Documentation

With literal

Implicit struct initializer for Rust based on this Rust post.

In the future, this literal may allow omitting the .. component if in the future Rust supports a way to infer the struct name.

Limitations

  • Requires a base object: either .. for Default::default() or ..o for o

Usage

use with_literal::with;
let y = 0.0;
let o: S = with! { x: 0.0, y, .. };