Skip to content

Commit dece573

Browse files
committed
Auto merge of #64575 - lzutao:fmt-primitives-doc, r=jonas-schievink
doc: Format some primitives examples r? @jonas-schievink
2 parents 64c0969 + bec0a76 commit dece573

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

src/libcore/num/mod.rs

+18-12
Original file line numberDiff line numberDiff line change
@@ -2092,11 +2092,14 @@ $to_xe_bytes_doc,
20922092
20932093
```
20942094
let bytes = ", $swap_op, stringify!($SelfT), ".to_ne_bytes();
2095-
assert_eq!(bytes, if cfg!(target_endian = \"big\") {
2095+
assert_eq!(
2096+
bytes,
2097+
if cfg!(target_endian = \"big\") {
20962098
", $be_bytes, "
20972099
} else {
20982100
", $le_bytes, "
2099-
});
2101+
}
2102+
);
21002103
```"),
21012104
#[stable(feature = "int_to_from_bytes", since = "1.32.0")]
21022105
#[rustc_const_unstable(feature = "const_int_conversion")]
@@ -2188,10 +2191,10 @@ $from_xe_bytes_doc,
21882191
21892192
```
21902193
let value = ", stringify!($SelfT), "::from_ne_bytes(if cfg!(target_endian = \"big\") {
2191-
", $be_bytes, "
2192-
} else {
2193-
", $le_bytes, "
2194-
});
2194+
", $be_bytes, "
2195+
} else {
2196+
", $le_bytes, "
2197+
});
21952198
assert_eq!(value, ", $swap_op, ");
21962199
```
21972200
@@ -3911,11 +3914,14 @@ $to_xe_bytes_doc,
39113914
39123915
```
39133916
let bytes = ", $swap_op, stringify!($SelfT), ".to_ne_bytes();
3914-
assert_eq!(bytes, if cfg!(target_endian = \"big\") {
3917+
assert_eq!(
3918+
bytes,
3919+
if cfg!(target_endian = \"big\") {
39153920
", $be_bytes, "
39163921
} else {
39173922
", $le_bytes, "
3918-
});
3923+
}
3924+
);
39193925
```"),
39203926
#[stable(feature = "int_to_from_bytes", since = "1.32.0")]
39213927
#[rustc_const_unstable(feature = "const_int_conversion")]
@@ -4007,10 +4013,10 @@ $from_xe_bytes_doc,
40074013
40084014
```
40094015
let value = ", stringify!($SelfT), "::from_ne_bytes(if cfg!(target_endian = \"big\") {
4010-
", $be_bytes, "
4011-
} else {
4012-
", $le_bytes, "
4013-
});
4016+
", $be_bytes, "
4017+
} else {
4018+
", $le_bytes, "
4019+
});
40144020
assert_eq!(value, ", $swap_op, ");
40154021
```
40164022

0 commit comments

Comments
 (0)