@@ -1146,7 +1146,9 @@ pub fn cfmakesane(termios: &mut Termios) {
1146
1146
pub fn tcgetattr < Fd : AsFd > ( fd : & Fd ) -> Result < Termios > {
1147
1147
let mut termios = mem:: MaybeUninit :: uninit ( ) ;
1148
1148
1149
- let res = unsafe { libc:: tcgetattr ( fd. as_fd ( ) . as_raw_fd ( ) , termios. as_mut_ptr ( ) ) } ;
1149
+ let res = unsafe {
1150
+ libc:: tcgetattr ( fd. as_fd ( ) . as_raw_fd ( ) , termios. as_mut_ptr ( ) )
1151
+ } ;
1150
1152
1151
1153
Errno :: result ( res) ?;
1152
1154
@@ -1159,10 +1161,18 @@ pub fn tcgetattr<Fd: AsFd>(fd: &Fd) -> Result<Termios> {
1159
1161
/// `tcsetattr()` reconfigures the given port based on a given `Termios` structure. This change
1160
1162
/// takes affect at a time specified by `actions`. Note that this function may return success if
1161
1163
/// *any* of the parameters were successfully set, not only if all were set successfully.
1162
- pub fn tcsetattr < Fd : AsFd > ( fd : & Fd , actions : SetArg , termios : & Termios ) -> Result < ( ) > {
1164
+ pub fn tcsetattr < Fd : AsFd > (
1165
+ fd : & Fd ,
1166
+ actions : SetArg ,
1167
+ termios : & Termios ,
1168
+ ) -> Result < ( ) > {
1163
1169
let inner_termios = termios. get_libc_termios ( ) ;
1164
1170
Errno :: result ( unsafe {
1165
- libc:: tcsetattr ( fd. as_fd ( ) . as_raw_fd ( ) , actions as c_int , & * inner_termios)
1171
+ libc:: tcsetattr (
1172
+ fd. as_fd ( ) . as_raw_fd ( ) ,
1173
+ actions as c_int ,
1174
+ & * inner_termios,
1175
+ )
1166
1176
} )
1167
1177
. map ( drop)
1168
1178
}
@@ -1179,7 +1189,10 @@ pub fn tcdrain<Fd: AsFd>(fd: &Fd) -> Result<()> {
1179
1189
/// `tcflow()` suspends of resumes the transmission or reception of data for the given port
1180
1190
/// depending on the value of `action`.
1181
1191
pub fn tcflow < Fd : AsFd > ( fd : & Fd , action : FlowArg ) -> Result < ( ) > {
1182
- Errno :: result ( unsafe { libc:: tcflow ( fd. as_fd ( ) . as_raw_fd ( ) , action as c_int ) } ) . map ( drop)
1192
+ Errno :: result ( unsafe {
1193
+ libc:: tcflow ( fd. as_fd ( ) . as_raw_fd ( ) , action as c_int )
1194
+ } )
1195
+ . map ( drop)
1183
1196
}
1184
1197
1185
1198
/// Discard data in the output or input queue (see
@@ -1188,7 +1201,10 @@ pub fn tcflow<Fd: AsFd>(fd: &Fd, action: FlowArg) -> Result<()> {
1188
1201
/// `tcflush()` will discard data for a terminal port in the input queue, output queue, or both
1189
1202
/// depending on the value of `action`.
1190
1203
pub fn tcflush < Fd : AsFd > ( fd : & Fd , action : FlushArg ) -> Result < ( ) > {
1191
- Errno :: result ( unsafe { libc:: tcflush ( fd. as_fd ( ) . as_raw_fd ( ) , action as c_int ) } ) . map ( drop)
1204
+ Errno :: result ( unsafe {
1205
+ libc:: tcflush ( fd. as_fd ( ) . as_raw_fd ( ) , action as c_int )
1206
+ } )
1207
+ . map ( drop)
1192
1208
}
1193
1209
1194
1210
/// Send a break for a specific duration (see
@@ -1197,7 +1213,10 @@ pub fn tcflush<Fd: AsFd>(fd: &Fd, action: FlushArg) -> Result<()> {
1197
1213
/// When using asynchronous data transmission `tcsendbreak()` will transmit a continuous stream
1198
1214
/// of zero-valued bits for an implementation-defined duration.
1199
1215
pub fn tcsendbreak < Fd : AsFd > ( fd : & Fd , duration : c_int ) -> Result < ( ) > {
1200
- Errno :: result ( unsafe { libc:: tcsendbreak ( fd. as_fd ( ) . as_raw_fd ( ) , duration) } ) . map ( drop)
1216
+ Errno :: result ( unsafe {
1217
+ libc:: tcsendbreak ( fd. as_fd ( ) . as_raw_fd ( ) , duration)
1218
+ } )
1219
+ . map ( drop)
1201
1220
}
1202
1221
1203
1222
feature ! {
0 commit comments