Registry / utility / smart-default

smart-default

JSON →
library0.7.1rscratesunverified

Rust custom-derive macro for Default with more control on the fields

# Cargo.toml [dependencies] smart-default = "0.7.1"
INSTALL
IMPORT
SIG · SMART-DEFAULT
S
smart-default
utilityrustv0.7.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SmartDefault
use smart_default::SmartDefault;

Derives Default with custom default values for each field.

use smart_default::SmartDefault; #[derive(SmartDefault)] struct Config { #[default = 8080] port: u16, #[default("localhost")] host: String, } let cfg = Config::default(); println!("{}:{}", cfg.host, cfg.port);
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.7.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Amazon
1
Resources
smart-default — cargo add smart-default · libregistry