rust/library/core/src/fmt
bors 9257f5aad0 Auto merge of #94530 - tmiasko:alignment-impls, r=dtolnay
Implement Copy, Clone, PartialEq and Eq for core::fmt::Alignment

Alignment is a fieldless exhaustive enum, so it is already possible to
clone and compare it by matching, but it is inconvenient to do so. For
example, if one would like to create a struct describing a formatter
configuration and provide a clone implementation:

```rust
pub struct Format {
    fill: char,
    width: Option<usize>,
    align: fmt::Alignment,
}

impl Clone for Format {
    fn clone(&self) -> Self {
        Format {
            align: match self.align {
                fmt::Alignment::Left => fmt::Alignment::Left,
                fmt::Alignment::Right => fmt::Alignment::Right,
                fmt::Alignment::Center => fmt::Alignment::Center,
            },
            .. *self
        }
    }
}
```

Derive Copy, Clone, PartialEq, and Eq for Alignment for convenience.
2022-05-21 19:49:51 +00:00
..
rt mv std libs to library/ 2020-07-27 19:51:13 -05:00
builders.rs Remove needless borrows from core::fmt 2022-02-25 16:06:23 +00:00
float.rs Rollup merge of #86479 - exphp-forks:float-debug-exponential, r=yaahc 2021-10-20 04:35:10 +09:00
mod.rs Auto merge of #94530 - tmiasko:alignment-impls, r=dtolnay 2022-05-21 19:49:51 +00:00
nofloat.rs core: add unstable no_fp_fmt_parse to disable float fmt/parse code 2021-07-02 22:52:37 +01:00
num.rs Improve formatting in macro 2022-03-19 09:44:52 +01:00