Skip to content

Commit

Permalink
Run cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
fitzgen committed Apr 13, 2018
1 parent b47a834 commit c9c2cbf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
13 changes: 8 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,7 @@ pub trait SharedLibrary: Sized + Debug {
fn avma_to_svma(&self, address: Avma) -> Svma {
let bias = self.virtual_memory_bias();
let reverse_bias = -bias.0;
Svma(unsafe {
address.0.offset(reverse_bias)
})
Svma(unsafe { address.0.offset(reverse_bias) })
}

/// Find all shared libraries in this process and invoke `f` with each one.
Expand Down Expand Up @@ -340,10 +338,15 @@ mod tests {
fn panic_in_each() {
use std::panic;

match panic::catch_unwind(|| { TargetSharedLibrary::each(|_| panic!("uh oh")); }) {
match panic::catch_unwind(|| {
TargetSharedLibrary::each(|_| panic!("uh oh"));
}) {
Ok(()) => panic!("Expected a panic, but didn't get one"),
Err(any) => {
assert!(any.is::<&'static str>(), "panic value should be a &'static str");
assert!(
any.is::<&'static str>(),
"panic value should be a &'static str"
);
assert_eq!(*any.downcast_ref::<&'static str>().unwrap(), "uh oh");
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/unsupported.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//! The fallback implementation of the [SharedLibrary
//! trait](../trait.SharedLibrary.html) that does nothing.
use super::{Bias, IterationControl, Svma, SharedLibraryId};
use super::Segment as SegmentTrait;
use super::SharedLibrary as SharedLibraryTrait;
use super::{Bias, IterationControl, SharedLibraryId, Svma};

use std::ffi::CStr;
use std::marker::PhantomData;
Expand Down Expand Up @@ -48,7 +48,6 @@ impl<'a> Iterator for SegmentIter<'a> {
}
}


/// The fallback implementation of the [SharedLibrary
/// trait](../trait.SharedLibrary.html).
#[derive(Debug)]
Expand Down Expand Up @@ -81,8 +80,9 @@ impl<'a> SharedLibraryTrait for SharedLibrary<'a> {
}

fn each<F, C>(_f: F)
where F: FnMut(&Self) -> C,
C: Into<IterationControl>
where
F: FnMut(&Self) -> C,
C: Into<IterationControl>,
{
}
}

0 comments on commit c9c2cbf

Please sign in to comment.