Skip to content

Commit d7ec91c

Browse files
committed
Fixed most of clippy's warnings
1 parent 2e93966 commit d7ec91c

File tree

15 files changed

+19
-23
lines changed

15 files changed

+19
-23
lines changed

interpol-rs/src/interpol.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ pub trait Register: Send + Sync {
4545
#[macro_export]
4646
macro_rules! impl_register {
4747
($t:ty) => {
48-
use crate::interpol::Register;
4948
use std::collections::TryReserveError;
49+
use $crate::interpol::Register;
5050

5151
#[typetag::serde]
5252
impl Register for $t {
@@ -57,7 +57,7 @@ macro_rules! impl_register {
5757
Ok(())
5858
}
5959

60-
fn tsc(&self) -> crate::types::Tsc {
60+
fn tsc(&self) -> $crate::types::Tsc {
6161
self.tsc
6262
}
6363
}
@@ -117,18 +117,14 @@ fn serialize(
117117
println!("[interpol]: serializing traces for rank {current_rank}");
118118
let ser_traces = serde_json::to_string_pretty(events)
119119
.expect("failed to serialize vector contents to string");
120-
let filename = format!(
121-
"{}/rank{}_traces.json",
122-
INTERPOL_DIR,
123-
current_rank.to_string()
124-
);
120+
let filename = format!("{}/rank{}_traces.json", INTERPOL_DIR, current_rank);
125121

126122
fs::create_dir_all(INTERPOL_DIR)?;
127123
let mut file = File::options()
128124
.write(true)
129125
.truncate(true)
130126
.create(true)
131-
.open(filename.clone())?;
127+
.open(filename)?;
132128
write!(file, "{}", ser_traces)?;
133129
Ok(())
134130
}

interpol-rs/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl From<std::collections::TryReserveError> for InterpolError {
5252
#[macro_export]
5353
macro_rules! impl_builder_error {
5454
($t:ty) => {
55-
use crate::{InterpolError, InterpolErrorKind};
55+
use $crate::{InterpolError, InterpolErrorKind};
5656

5757
impl From<$t> for InterpolError {
5858
fn from(error: $t) -> Self {

interpol-rs/src/mpi_events/collectives/mpi_ibcast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use serde::{Deserialize, Serialize};
1414
/// - the tag of the communication;
1515
/// - the current value of the Time Stamp counter before the call to `MPI_Ibcast`.
1616
/// - the duration of the call.
17-
#[derive(Builder, Clone, Debug, PartialEq, Serialize, Deserialize)]
17+
#[derive(Builder, Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
1818
pub struct MpiIbcast {
1919
current_rank: MpiRank,
2020
partner_rank: MpiRank,

interpol-rs/src/mpi_events/collectives/mpi_igather.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use serde::{Deserialize, Serialize};
1515
/// - the tag of the communication;
1616
/// - the current value of the Time Stamp counter before the call to `MPI_Igather`.
1717
/// - the duration of the call.
18-
#[derive(Builder, Clone, Debug, PartialEq, Serialize, Deserialize)]
18+
#[derive(Builder, Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
1919
pub struct MpiIgather {
2020
current_rank: MpiRank,
2121
partner_rank: MpiRank,

interpol-rs/src/mpi_events/collectives/mpi_ireduce.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use serde::{Deserialize, Serialize};
1515
/// - the tag of the communication;
1616
/// - the current value of the Time Stamp counter before the call to `MPI_Ireduce`.
1717
/// - the duration of the call.
18-
#[derive(Builder, Clone, Debug, PartialEq, Serialize, Deserialize)]
18+
#[derive(Builder, Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
1919
pub struct MpiIreduce {
2020
current_rank: MpiRank,
2121
partner_rank: MpiRank,

interpol-rs/src/mpi_events/collectives/mpi_iscatter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use serde::{Deserialize, Serialize};
1515
/// - the tag of the communication;
1616
/// - the current value of the Time Stamp counter before the call to `MPI_Iscatter`.
1717
/// - the duration of the call.
18-
#[derive(Builder, Clone, Debug, PartialEq, Serialize, Deserialize)]
18+
#[derive(Builder, Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
1919
pub struct MpiIscatter {
2020
current_rank: MpiRank,
2121
partner_rank: MpiRank,

interpol-rs/src/mpi_events/point_to_point/mpi_irecv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use serde::{Deserialize, Serialize};
1515
/// - the duration of the call.
1616
/// The TSC is measured using the `rdtscp` and `lfence` instructions (see Intel documentation for
1717
/// further information).
18-
#[derive(Builder, Clone, Debug, PartialEq, Serialize, Deserialize)]
18+
#[derive(Builder, Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
1919
pub struct MpiIrecv {
2020
current_rank: MpiRank,
2121
partner_rank: MpiRank,

interpol-rs/src/mpi_events/point_to_point/mpi_isend.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use serde::{Deserialize, Serialize};
1515
/// - the duration of the call.
1616
/// The TSC is measured using the `rdtscp` and `lfence` instructions (see Intel documentation for
1717
/// further information).
18-
#[derive(Builder, Clone, Debug, PartialEq, Serialize, Deserialize)]
18+
#[derive(Builder, Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
1919
pub struct MpiIsend {
2020
current_rank: MpiRank,
2121
partner_rank: MpiRank,

interpol-rs/src/mpi_events/point_to_point/mpi_recv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use serde::{Deserialize, Serialize};
1616
/// - the duration of the call.
1717
/// The TSC is measured using the `rdtscp` and `lfence` instructions (see Intel documentation for
1818
/// further information).
19-
#[derive(Builder, Clone, Debug, PartialEq, Serialize, Deserialize)]
19+
#[derive(Builder, Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
2020
pub struct MpiRecv {
2121
current_rank: MpiRank,
2222
partner_rank: MpiRank,

interpol-rs/src/mpi_events/point_to_point/mpi_send.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use serde::{Deserialize, Serialize};
1616
/// - the duration of the call.
1717
/// The TSC is measured using the `rdtscp` and `lfence` instructions (see Intel documentation for
1818
/// further information).
19-
#[derive(Builder, Clone, Debug, PartialEq, Serialize, Deserialize)]
19+
#[derive(Builder, Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
2020
pub struct MpiSend {
2121
current_rank: MpiRank,
2222
partner_rank: MpiRank,

0 commit comments

Comments
 (0)