@@ -27,16 +27,14 @@ mod builders;
27
27
28
28
#[ unstable( feature = "fmt_flags_align" , issue = "27726" ) ]
29
29
/// Possible alignments returned by `Formatter::align`
30
- #[ derive( Debug ) ]
30
+ #[ derive( Debug , Copy , Clone , PartialEq , Eq ) ]
31
31
pub enum Alignment {
32
32
/// Indication that contents should be left-aligned.
33
33
Left ,
34
34
/// Indication that contents should be right-aligned.
35
35
Right ,
36
36
/// Indication that contents should be center-aligned.
37
- Center ,
38
- /// No alignment was requested.
39
- Unknown ,
37
+ Center
40
38
}
41
39
42
40
#[ stable( feature = "debug_builders" , since = "1.2.0" ) ]
@@ -1385,14 +1383,13 @@ impl<'a> Formatter<'a> {
1385
1383
pub fn fill ( & self ) -> char { self . fill }
1386
1384
1387
1385
/// Flag indicating what form of alignment was requested
1388
- #[ unstable( feature = "fmt_flags_align" , reason = "method was just created" ,
1389
- issue = "27726" ) ]
1390
- pub fn align ( & self ) -> Alignment {
1386
+ #[ stable( feature = "fmt_flags_align" , since = "1.27.0" ) ]
1387
+ pub fn align ( & self ) -> Option < Alignment > {
1391
1388
match self . align {
1392
- rt:: v1:: Alignment :: Left => Alignment :: Left ,
1393
- rt:: v1:: Alignment :: Right => Alignment :: Right ,
1394
- rt:: v1:: Alignment :: Center => Alignment :: Center ,
1395
- rt:: v1:: Alignment :: Unknown => Alignment :: Unknown ,
1389
+ rt:: v1:: Alignment :: Left => Some ( Alignment :: Left ) ,
1390
+ rt:: v1:: Alignment :: Right => Some ( Alignment :: Right ) ,
1391
+ rt:: v1:: Alignment :: Center => Some ( Alignment :: Center ) ,
1392
+ rt:: v1:: Alignment :: Unknown => None ,
1396
1393
}
1397
1394
}
1398
1395
0 commit comments