Skip to content

implement Default for arrays #25169

Closed
Closed
@vks

Description

@vks

Something like

impl<T: Default> for [T; 2] {                                                       
    fn default() -> [T; 2] {                                                        
        [Default::default(), Default::default()]                                    
    }                                                                               
}

for N=0..33 should be added to src/libcore/default.rs. The question is how to do that with a macro.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: An issue proposing an enhancement or a PR with one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions