Skip to content

Commit

Permalink
Clippy --fix run
Browse files Browse the repository at this point in the history
  • Loading branch information
rdaum committed Dec 29, 2023
1 parent 3ecfec0 commit 0aeed16
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 25 deletions.
2 changes: 1 addition & 1 deletion crates/daemon/src/rpc_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ impl RpcServer {

// TODO: change result of login to return this information, rather than just Objid, so
// we're not dependent on this.
let connect_type = if args.get(0) == Some(&"create".to_string()) {
let connect_type = if args.first() == Some(&"create".to_string()) {
ConnectType::Created
} else {
ConnectType::Connected
Expand Down
10 changes: 5 additions & 5 deletions crates/db/tests/jepsen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ mod tests {
})
.collect::<Vec<_>>();

let db = TupleBox::new(1 << 24, 4096, None, &relations, 0).await;
db

TupleBox::new(1 << 24, 4096, None, &relations, 0).await
}

fn from_val(value: i64) -> SliceRef {
Expand All @@ -74,7 +74,7 @@ mod tests {

async fn check_expected(
process: i64,
db: Arc<TupleBox>,
_db: Arc<TupleBox>,
tx: &Transaction,
relation: RelationId,
expected_values: &Option<Vec<i64>>,
Expand Down Expand Up @@ -146,7 +146,7 @@ mod tests {
check_expected(
process,
db.clone(),
&tx,
tx,
relation,
&expected_values,
action_type,
Expand Down Expand Up @@ -201,7 +201,7 @@ mod tests {
db.clone(),
&tx,
relation,
&values,
values,
e.r#type,
)
.await;
Expand Down
2 changes: 1 addition & 1 deletion crates/kernel/src/tasks/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ impl Scheduler {
let mut number_readblocked_tasks = 0;
let number_tasks = inner.tasks.len();

for (_, task) in &inner.tasks {
for task in inner.tasks.values() {
if task.suspended {
number_suspended_tasks += 1;
}
Expand Down
19 changes: 1 addition & 18 deletions crates/values/src/var/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,24 +246,7 @@ impl PartialEq<Self> for Var {
}

impl PartialOrd<Self> for Var {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
match (self.variant(), other.variant()) {
(Variant::None, Variant::None) => Some(Ordering::Equal),
(Variant::Str(l), Variant::Str(r)) => l.partial_cmp(r),
(Variant::Obj(l), Variant::Obj(r)) => l.partial_cmp(r),
(Variant::Int(l), Variant::Int(r)) => l.partial_cmp(r),
(Variant::Float(l), Variant::Float(r)) => R64::from(*l).partial_cmp(&R64::from(*r)),
(Variant::Err(l), Variant::Err(r)) => l.partial_cmp(r),
(Variant::List(l), Variant::List(r)) => l.partial_cmp(r),
(Variant::None, _) => Some(Ordering::Less),
(Variant::Str(_), _) => Some(Ordering::Less),
(Variant::Obj(_), _) => Some(Ordering::Less),
(Variant::Int(_), _) => Some(Ordering::Less),
(Variant::Float(_), _) => Some(Ordering::Less),
(Variant::Err(_), _) => Some(Ordering::Less),
(Variant::List(_), _) => Some(Ordering::Less),
}
}
fn partial_cmp(&self, other: &Self) -> Option<Ordering> { Some(self.cmp(other)) }
}

impl Ord for Var {
Expand Down

0 comments on commit 0aeed16

Please sign in to comment.