summaryrefslogtreecommitdiff
path: root/src/sys/termios.rs
diff options
context:
space:
mode:
authorAlan Somers <asomers@gmail.com>2020-05-31 15:17:16 -0600
committerAlan Somers <asomers@gmail.com>2020-05-31 19:07:15 -0600
commit1ae5dd8b16aed61958fd3ce488ed7fd459743652 (patch)
tree17c28555c9b2cd3db3741dcd28b7401d08ad3678 /src/sys/termios.rs
parent84e66d7a29234d16d62c5fa5bc5b66ad5504c2a2 (diff)
downloadnix-1ae5dd8b16aed61958fd3ce488ed7fd459743652.zip
Convert the crate to edition 2018
Diffstat (limited to 'src/sys/termios.rs')
-rw-r--r--src/sys/termios.rs14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/sys/termios.rs b/src/sys/termios.rs
index 0b9bfe90..5af5a158 100644
--- a/src/sys/termios.rs
+++ b/src/sys/termios.rs
@@ -74,7 +74,6 @@
//! Additionally round-tripping baud rates is consistent across platforms:
//!
//! ```rust
-//! # extern crate nix;
//! # use nix::sys::termios::{BaudRate, cfgetispeed, cfgetospeed, cfsetispeed, cfsetspeed, Termios};
//! # fn main() {
//! # let mut t = unsafe { Termios::default_uninit() };
@@ -93,7 +92,6 @@
#![cfg_attr(not(any(target_os = "freebsd", target_os = "dragonfly", target_os = "ios",
target_os = "macos", target_os = "netbsd", target_os = "openbsd")),
doc = " ```rust")]
-//! # extern crate nix;
//! # use nix::sys::termios::{BaudRate, cfgetispeed, cfgetospeed, cfsetspeed, Termios};
//! # fn main() {
//! # let mut t = unsafe { Termios::default_uninit() };
@@ -111,7 +109,6 @@
#![cfg_attr(not(any(target_os = "freebsd", target_os = "dragonfly", target_os = "ios",
target_os = "macos", target_os = "netbsd", target_os = "openbsd")),
doc = " ```rust,ignore")]
-//! # extern crate nix;
//! # use nix::sys::termios::{BaudRate, cfgetispeed, cfgetospeed, cfsetspeed, Termios};
//! # fn main() {
//! # let mut t = unsafe { Termios::default_uninit() };
@@ -129,7 +126,6 @@
#![cfg_attr(not(any(target_os = "freebsd", target_os = "dragonfly", target_os = "ios",
target_os = "macos", target_os = "netbsd", target_os = "openbsd")),
doc = " ```rust,ignore")]
-//! # extern crate nix;
//! # use nix::sys::termios::{BaudRate, cfgetispeed, cfsetspeed, Termios};
//! # fn main() {
//! # let mut t = unsafe { Termios::default_uninit() };
@@ -148,7 +144,6 @@
#![cfg_attr(not(any(target_os = "freebsd", target_os = "dragonfly", target_os = "ios",
target_os = "macos", target_os = "netbsd", target_os = "openbsd")),
doc = " ```rust,ignore")]
-//! # extern crate nix;
//! # use nix::sys::termios::{cfsetispeed, cfsetospeed, cfsetspeed, Termios};
//! # fn main() {
//! # let mut t = unsafe { Termios::default_uninit() };
@@ -157,15 +152,16 @@
//! cfsetspeed(&mut t, 9600u32);
//! # }
//! ```
-use {Error, Result};
-use errno::Errno;
+use cfg_if::cfg_if;
+use crate::{Error, Result};
+use crate::errno::Errno;
use libc::{self, c_int, tcflag_t};
use std::cell::{Ref, RefCell};
use std::convert::{From, TryFrom};
use std::mem;
use std::os::unix::io::RawFd;
-use ::unistd::Pid;
+use crate::unistd::Pid;
/// Stores settings for the termios API
///
@@ -193,8 +189,6 @@ impl Termios {
/// This can be used for interfacing with other FFI functions like:
///
/// ```rust
- /// # extern crate libc;
- /// # extern crate nix;
/// # fn main() {
/// # use nix::sys::termios::Termios;
/// # let mut termios = unsafe { Termios::default_uninit() };