Pre-RFC: Optional FIelds

How would this argument evolve if default field values existed in general? For example, I could imagine that a configuration struct might no longer have a bunch of Nones, like one could be

struct DeflateOptions {
    level: CompressionLevel = CompressionLevel::Balanced,
    dictionary_size: usize = 1 << 15,
    word_size: usize = 32,
}
5 Likes