File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -198,29 +198,11 @@ fn is_atomic_composite_specifier(specifier: &str) -> bool {
198198/// This includes text specifiers and numeric specifiers like %e and %k
199199/// that use blank-padding by default in GNU date.
200200fn is_space_padded_specifier ( specifier : & str ) -> bool {
201- matches ! (
202- specifier. chars( ) . last( ) ,
203- Some (
204- 'A' | 'a'
205- | 'B'
206- | 'b'
207- | 'h'
208- | 'Z'
209- | 'p'
210- | 'P'
211- | 'e'
212- | 'k'
213- | 'l'
214- | 'D'
215- | 'F'
216- | 'T'
217- | 'r'
218- | 'R'
219- | 'c'
220- | 'x'
221- | 'X'
201+ is_atomic_composite_specifier ( specifier)
202+ || matches ! (
203+ specifier. chars( ) . last( ) ,
204+ Some ( 'A' | 'a' | 'B' | 'b' | 'h' | 'Z' | 'p' | 'P' | 'e' | 'k' | 'l' )
222205 )
223- )
224206}
225207
226208/// Returns the default width for a specifier.
Original file line number Diff line number Diff line change @@ -1967,11 +1967,14 @@ fn test_date_strftime_flag_on_composite() {
19671967fn test_date_strftime_composite_modifiers_are_atomic ( ) {
19681968 let test_cases = [
19691969 ( "+%-D" , "06/15/24\n " ) ,
1970+ ( "+%^D" , "06/15/24\n " ) ,
19701971 ( "+%-F" , "2024-06-15\n " ) ,
19711972 ( "+%-T" , "03:04:05\n " ) ,
19721973 ( "+%-r" , "03:04:05 AM\n " ) ,
19731974 ( "+%-R" , "03:04\n " ) ,
19741975 ( "+%-c" , "Sat Jun 15 03:04:05 2024\n " ) ,
1976+ ( "+%^c" , "SAT JUN 15 03:04:05 2024\n " ) ,
1977+ ( "+%#c" , "SAT JUN 15 03:04:05 2024\n " ) ,
19751978 ( "+%-x" , "06/15/24\n " ) ,
19761979 ( "+%-X" , "03:04:05\n " ) ,
19771980 ( "+%_D" , "06/15/24\n " ) ,
You can’t perform that action at this time.
0 commit comments