Skip to content

Commit 9f81f40

Browse files
phip1611eldruin
authored andcommitted
remove legacy, improved code quality
1 parent bd58aac commit 9f81f40

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

src/lib.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
// option. This file may not be copied, modified, or distributed
77
// except according to those terms.
88

9-
#![crate_type = "lib"]
10-
#![crate_name = "spidev"]
11-
129
//! # Spidev
1310
//!
1411
//! The `spidev` crate provides access to Linux spidev devices
@@ -68,15 +65,10 @@
6865
//! }
6966
//! ```
7067
71-
extern crate libc;
72-
#[macro_use]
73-
extern crate nix;
74-
#[macro_use]
75-
extern crate bitflags;
76-
7768
pub mod spidevioctl;
7869
pub use crate::spidevioctl::SpidevTransfer;
7970

71+
use bitflags::bitflags;
8072
use std::io;
8173
use std::io::prelude::*;
8274
use std::fs::{File, OpenOptions};

src/spidevioctl.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66
// option. This file may not be copied, modified, or distributed
77
// except according to those terms.
88

9-
#![allow(dead_code)]
10-
11-
use nix;
9+
// macros import
10+
use nix::{ioctl_read, ioctl_write_ptr, ioctl_write_buf};
1211
use std::io;
1312
use std::marker::PhantomData;
1413
use std::os::unix::prelude::*;
@@ -113,7 +112,7 @@ impl<'a, 'b> spi_ioc_transfer<'a, 'b> {
113112
}
114113

115114
mod ioctl {
116-
use super::spi_ioc_transfer;
115+
use super::*;
117116

118117
const SPI_IOC_MAGIC: u8 = 'k' as u8;
119118
const SPI_IOC_NR_TRANSFER: u8 = 0;

0 commit comments

Comments
 (0)