with_literal

Crates.iowith_literal
lib.rswith_literal
version1.0.0
sourcesrc
created_at2023-11-25 15:45:11.543758
updated_at2023-11-25 15:45:11.543758
descriptionWith literal
homepage
repositoryhttps://github.com/hydroper/rust-with-literal
max_upload_size
id1048374
size4,925
Matheus Dias de Souza (hydroper)

documentation

README

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, .. };
Commit count: 1

cargo fmt