Skip to content

Fix compiler warnings (requires rustc 1.36.0). #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ matrix:

# MSRV
- env: TARGET=x86_64-unknown-linux-gnu
rust: 1.34.0
rust: 1.36.0
if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master)

before_install:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ to be considered reliable.

## Minimum Supported Rust Version (MSRV)

This crate is guaranteed to compile on stable Rust 1.34.0 and up. It *might*
This crate is guaranteed to compile on stable Rust 1.36.0 and up. It *might*
compile with older versions but that may change in any new patch release.

## License
Expand Down
32 changes: 16 additions & 16 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ impl Chip {
/// Open the GPIO Chip at the provided path (e.g. `/dev/gpiochip<N>`)
pub fn new<P: AsRef<Path>>(path: P) -> Result<Chip> {
let f = File::open(path.as_ref())?;
let mut info: ffi::gpiochip_info = unsafe { mem::uninitialized() };
let mut info: ffi::gpiochip_info = unsafe { mem::MaybeUninit::uninit().assume_init() };
ffi::gpio_get_chipinfo_ioctl(f.as_raw_fd(), &mut info)?;

Ok(Chip {
Expand Down Expand Up @@ -328,12 +328,12 @@ pub struct LineInfo {
consumer: Option<String>,
}

/// Line Request Flags
///
/// Maps to kernel [`GPIOHANDLE_REQUEST_*`] flags.
///
/// [`GPIOHANDLE_REQUEST_*`]: https://elixir.bootlin.com/linux/v4.9.127/source/include/uapi/linux/gpio.h#L58
bitflags! {
/// Line Request Flags
///
/// Maps to kernel [`GPIOHANDLE_REQUEST_*`] flags.
///
/// [`GPIOHANDLE_REQUEST_*`]: https://elixir.bootlin.com/linux/v4.9.127/source/include/uapi/linux/gpio.h#L58
pub struct LineRequestFlags: u32 {
const INPUT = (1 << 0);
const OUTPUT = (1 << 1);
Expand All @@ -343,25 +343,25 @@ bitflags! {
}
}

/// Event request flags
///
/// Maps to kernel [`GPIOEVENT_REQEST_*`] flags.
///
/// [`GPIOEVENT_REQUEST_*`]: https://elixir.bootlin.com/linux/v4.9.127/source/include/uapi/linux/gpio.h#L109
bitflags! {
/// Event request flags
///
/// Maps to kernel [`GPIOEVENT_REQEST_*`] flags.
///
/// [`GPIOEVENT_REQUEST_*`]: https://elixir.bootlin.com/linux/v4.9.127/source/include/uapi/linux/gpio.h#L109
pub struct EventRequestFlags: u32 {
const RISING_EDGE = (1 << 0);
const FALLING_EDGE = (1 << 1);
const BOTH_EDGES = Self::RISING_EDGE.bits | Self::FALLING_EDGE.bits;
}
}

/// Informational Flags
///
/// Maps to kernel [`GPIOLINE_FLAG_*`] flags.
///
/// [`GPIOLINE_FLAG_*`]: https://elixir.bootlin.com/linux/v4.9.127/source/include/uapi/linux/gpio.h#L29
bitflags! {
/// Informational Flags
///
/// Maps to kernel [`GPIOLINE_FLAG_*`] flags.
///
/// [`GPIOLINE_FLAG_*`]: https://elixir.bootlin.com/linux/v4.9.127/source/include/uapi/linux/gpio.h#L29
pub struct LineFlags: u32 {
const KERNEL = (1 << 0);
const IS_OUT = (1 << 1);
Expand Down