aboutsummaryrefslogtreecommitdiffstats
path: root/components/profile_traits/ipc.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/profile_traits/ipc.rs')
-rw-r--r--components/profile_traits/ipc.rs18
1 files changed, 14 insertions, 4 deletions
diff --git a/components/profile_traits/ipc.rs b/components/profile_traits/ipc.rs
index fe64d54ef07..cd4553ea8bc 100644
--- a/components/profile_traits/ipc.rs
+++ b/components/profile_traits/ipc.rs
@@ -10,12 +10,18 @@ use time;
use time::ProfilerCategory;
use time::ProfilerChan;
-pub struct IpcReceiver<T> where T: for<'de> Deserialize<'de> + Serialize {
+pub struct IpcReceiver<T>
+where
+ T: for<'de> Deserialize<'de> + Serialize,
+{
ipc_receiver: ipc::IpcReceiver<T>,
time_profile_chan: ProfilerChan,
}
-impl<T> IpcReceiver<T> where T: for<'de> Deserialize<'de> + Serialize {
+impl<T> IpcReceiver<T>
+where
+ T: for<'de> Deserialize<'de> + Serialize,
+{
pub fn recv(&self) -> Result<T, bincode::Error> {
time::profile(
ProfilerCategory::IpcReceiver,
@@ -34,8 +40,12 @@ impl<T> IpcReceiver<T> where T: for<'de> Deserialize<'de> + Serialize {
}
}
-pub fn channel<T>(time_profile_chan: ProfilerChan) -> Result<(ipc::IpcSender<T>, IpcReceiver<T>), Error>
- where T: for<'de> Deserialize<'de> + Serialize, {
+pub fn channel<T>(
+ time_profile_chan: ProfilerChan,
+) -> Result<(ipc::IpcSender<T>, IpcReceiver<T>), Error>
+where
+ T: for<'de> Deserialize<'de> + Serialize,
+{
let (ipc_sender, ipc_receiver) = ipc::channel()?;
let profiled_ipc_receiver = IpcReceiver {
ipc_receiver,