Skip to content

Commit

Permalink
Merge pull request #74 from bastion-rs/fix-clippy-errors
Browse files Browse the repository at this point in the history
Fix clippy errors
  • Loading branch information
vertexclique authored Nov 8, 2019
2 parents 815aceb + 01d91a1 commit 75a3826
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions bastion-executor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
//!
//!
// Discarded lints
#![allow(clippy::if_same_then_else)]
// Force missing implementations
#![warn(missing_docs)]
#![warn(missing_debug_implementations)]
Expand Down
7 changes: 2 additions & 5 deletions lightproc/src/layout_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@ pub(crate) fn extend(layout: Layout, next: Layout) -> (Layout, usize) {
let offset = layout
.size()
.checked_add(pad)
.ok_or(Error::new(
ErrorKind::Other,
"Padding overflow check failed",
))
.ok_or_else(|| Error::new(ErrorKind::Other, "Padding overflow check failed"))
.unwrap();
let new_size = offset
.checked_add(next.size())
.ok_or(Error::new(ErrorKind::Other, "New size can't be computed"))
.ok_or_else(|| Error::new(ErrorKind::Other, "New size can't be computed"))
.unwrap();

let layout = Layout::from_size_align(new_size, new_align).unwrap();
Expand Down
3 changes: 3 additions & 0 deletions lightproc/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Discarded lints
#![allow(clippy::cast_ptr_alignment)]

mod catch_unwind;
mod layout_helpers;
mod proc_data;
Expand Down
2 changes: 1 addition & 1 deletion lightproc/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
///
/// This flag can't be set when the proc is completed. However, it can be set while the proc is
/// running, in which case it will be rescheduled as soon as polling finishes.
pub(crate) const SCHEDULED: usize = 1 << 0;
pub(crate) const SCHEDULED: usize = 1;

/// Set if the proc is running.
///
Expand Down

0 comments on commit 75a3826

Please sign in to comment.