1 stable release

1.0.0 Nov 25, 2023

#8 in #infer


Used in agera

MIT/Apache

5KB
81 lines

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, .. };

Dependencies

~215–650KB
~16K SLoC