Skip to content

Commit 7958fb0

Browse files
style: qualified path cleanups for clippy (#1090)
1 parent 550b17c commit 7958fb0

File tree

21 files changed

+135
-159
lines changed

21 files changed

+135
-159
lines changed

hydro_deploy/core/src/deployment.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,7 @@ impl Deployment {
4242
user: Option<String>,
4343
) -> Arc<RwLock<GCPComputeEngineHost>> {
4444
self.add_host(|id| {
45-
super::GCPComputeEngineHost::new(
46-
id,
47-
project,
48-
machine_type,
49-
image,
50-
region,
51-
network,
52-
user,
53-
)
45+
GCPComputeEngineHost::new(id, project, machine_type, image, region, network, user)
5446
})
5547
}
5648

hydro_deploy/hydro_cli/src/lib.rs

Lines changed: 48 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use core::hydroflow_crate::ports::HydroflowSource;
12
use std::collections::HashMap;
23
use std::ops::DerefMut;
34
use std::pin::Pin;
@@ -18,8 +19,6 @@ use pythonize::pythonize;
1819
use tokio::sync::oneshot::Sender;
1920
use tokio::sync::RwLock;
2021

21-
use crate::core::hydroflow_crate::ports::HydroflowSource;
22-
2322
mod cli;
2423
use hydro_deploy as core;
2524
use hydro_deploy::ssh::LaunchedSSHHost;
@@ -142,20 +141,20 @@ impl AnyhowWrapper {
142141
#[pyclass(subclass)]
143142
#[derive(Clone)]
144143
struct HydroflowSink {
145-
underlying: Arc<RwLock<dyn crate::core::hydroflow_crate::ports::HydroflowSink>>,
144+
underlying: Arc<RwLock<dyn core::hydroflow_crate::ports::HydroflowSink>>,
146145
}
147146

148147
#[pyclass(name = "Deployment")]
149148
pub struct Deployment {
150-
underlying: Arc<RwLock<crate::core::Deployment>>,
149+
underlying: Arc<RwLock<core::Deployment>>,
151150
}
152151

153152
#[pymethods]
154153
impl Deployment {
155154
#[new]
156155
fn new() -> Self {
157156
Deployment {
158-
underlying: Arc::new(RwLock::new(crate::core::Deployment::default())),
157+
underlying: Arc::new(RwLock::new(core::Deployment::default())),
159158
}
160159
}
161160

@@ -185,7 +184,7 @@ impl Deployment {
185184
user: Option<String>,
186185
) -> PyResult<Py<PyAny>> {
187186
let arc = self.underlying.blocking_write().add_host(|id| {
188-
crate::core::GCPComputeEngineHost::new(
187+
core::GCPComputeEngineHost::new(
189188
id,
190189
project,
191190
machine_type,
@@ -218,7 +217,7 @@ impl Deployment {
218217
user: Option<String>,
219218
) -> PyResult<Py<PyAny>> {
220219
let arc = self.underlying.blocking_write().add_host(|id| {
221-
crate::core::AzureHost::new(id, project, os_type, machine_size, image, region, user)
220+
core::AzureHost::new(id, project, os_type, machine_size, image, region, user)
222221
});
223222

224223
Ok(Py::new(
@@ -325,12 +324,12 @@ impl Deployment {
325324

326325
#[pyclass(subclass)]
327326
pub struct Host {
328-
underlying: Arc<RwLock<dyn crate::core::Host>>,
327+
underlying: Arc<RwLock<dyn core::Host>>,
329328
}
330329

331330
#[pyclass(extends=Host, subclass)]
332331
struct LocalhostHost {
333-
underlying: Arc<RwLock<crate::core::LocalhostHost>>,
332+
underlying: Arc<RwLock<core::LocalhostHost>>,
334333
}
335334

336335
#[pymethods]
@@ -354,24 +353,22 @@ impl LocalhostHost {
354353
#[pyclass]
355354
#[derive(Clone)]
356355
struct GCPNetwork {
357-
underlying: Arc<RwLock<crate::core::gcp::GCPNetwork>>,
356+
underlying: Arc<RwLock<core::gcp::GCPNetwork>>,
358357
}
359358

360359
#[pymethods]
361360
impl GCPNetwork {
362361
#[new]
363362
fn new(project: String, existing: Option<String>) -> Self {
364363
GCPNetwork {
365-
underlying: Arc::new(RwLock::new(crate::core::gcp::GCPNetwork::new(
366-
project, existing,
367-
))),
364+
underlying: Arc::new(RwLock::new(core::gcp::GCPNetwork::new(project, existing))),
368365
}
369366
}
370367
}
371368

372369
#[pyclass(extends=Host, subclass)]
373370
struct GCPComputeEngineHost {
374-
underlying: Arc<RwLock<crate::core::GCPComputeEngineHost>>,
371+
underlying: Arc<RwLock<core::GCPComputeEngineHost>>,
375372
}
376373

377374
#[pymethods]
@@ -414,7 +411,7 @@ impl GCPComputeEngineHost {
414411

415412
#[pyclass(extends=Host, subclass)]
416413
struct AzureHost {
417-
underlying: Arc<RwLock<crate::core::AzureHost>>,
414+
underlying: Arc<RwLock<core::AzureHost>>,
418415
}
419416

420417
#[pymethods]
@@ -457,7 +454,7 @@ impl AzureHost {
457454

458455
#[pyclass(subclass)]
459456
pub struct Service {
460-
underlying: Arc<RwLock<dyn crate::core::Service>>,
457+
underlying: Arc<RwLock<dyn core::Service>>,
461458
}
462459

463460
#[pymethods]
@@ -499,15 +496,15 @@ impl PyReceiver {
499496

500497
#[pyclass(extends=Service, subclass)]
501498
struct CustomService {
502-
underlying: Arc<RwLock<crate::core::CustomService>>,
499+
underlying: Arc<RwLock<core::CustomService>>,
503500
}
504501

505502
#[pymethods]
506503
impl CustomService {
507504
fn client_port(&self, py: Python<'_>) -> PyResult<Py<PyAny>> {
508-
let arc = Arc::new(RwLock::new(
509-
crate::core::custom_service::CustomClientPort::new(Arc::downgrade(&self.underlying)),
510-
));
505+
let arc = Arc::new(RwLock::new(core::custom_service::CustomClientPort::new(
506+
Arc::downgrade(&self.underlying),
507+
)));
511508

512509
Ok(Py::new(
513510
py,
@@ -523,7 +520,7 @@ impl CustomService {
523520
#[pyclass(extends=HydroflowSink, subclass)]
524521
#[derive(Clone)]
525522
struct CustomClientPort {
526-
underlying: Arc<RwLock<crate::core::custom_service::CustomClientPort>>,
523+
underlying: Arc<RwLock<core::custom_service::CustomClientPort>>,
527524
}
528525

529526
#[pymethods]
@@ -537,12 +534,10 @@ impl CustomClientPort {
537534

538535
fn tagged(&self, tag: u32) -> TaggedSource {
539536
TaggedSource {
540-
underlying: Arc::new(RwLock::new(
541-
crate::core::hydroflow_crate::ports::TaggedSource {
542-
source: self.underlying.clone(),
543-
tag,
544-
},
545-
)),
537+
underlying: Arc::new(RwLock::new(core::hydroflow_crate::ports::TaggedSource {
538+
source: self.underlying.clone(),
539+
tag,
540+
})),
546541
}
547542
}
548543

@@ -630,7 +625,7 @@ impl HydroflowCratePorts {
630625
#[pyclass(extends=HydroflowSink, subclass)]
631626
#[derive(Clone)]
632627
struct HydroflowCratePort {
633-
underlying: Arc<RwLock<crate::core::hydroflow_crate::ports::HydroflowPortConfig>>,
628+
underlying: Arc<RwLock<core::hydroflow_crate::ports::HydroflowPortConfig>>,
634629
}
635630

636631
#[pymethods]
@@ -659,38 +654,34 @@ impl HydroflowCratePort {
659654

660655
fn tagged(&self, tag: u32) -> TaggedSource {
661656
TaggedSource {
662-
underlying: Arc::new(RwLock::new(
663-
crate::core::hydroflow_crate::ports::TaggedSource {
664-
source: self.underlying.clone(),
665-
tag,
666-
},
667-
)),
657+
underlying: Arc::new(RwLock::new(core::hydroflow_crate::ports::TaggedSource {
658+
source: self.underlying.clone(),
659+
tag,
660+
})),
668661
}
669662
}
670663
}
671664

672665
#[pyfunction]
673666
fn demux(mapping: &PyDict) -> HydroflowSink {
674667
HydroflowSink {
675-
underlying: Arc::new(RwLock::new(
676-
crate::core::hydroflow_crate::ports::DemuxSink {
677-
demux: mapping
678-
.into_iter()
679-
.map(|(k, v)| {
680-
let k = k.extract::<u32>().unwrap();
681-
let v = v.extract::<HydroflowSink>().unwrap();
682-
(k, v.underlying)
683-
})
684-
.collect(),
685-
},
686-
)),
668+
underlying: Arc::new(RwLock::new(core::hydroflow_crate::ports::DemuxSink {
669+
demux: mapping
670+
.into_iter()
671+
.map(|(k, v)| {
672+
let k = k.extract::<u32>().unwrap();
673+
let v = v.extract::<HydroflowSink>().unwrap();
674+
(k, v.underlying)
675+
})
676+
.collect(),
677+
})),
687678
}
688679
}
689680

690681
#[pyclass(subclass)]
691682
#[derive(Clone)]
692683
struct TaggedSource {
693-
underlying: Arc<RwLock<crate::core::hydroflow_crate::ports::TaggedSource>>,
684+
underlying: Arc<RwLock<core::hydroflow_crate::ports::TaggedSource>>,
694685
}
695686

696687
#[pymethods]
@@ -704,20 +695,18 @@ impl TaggedSource {
704695

705696
fn tagged(&self, tag: u32) -> TaggedSource {
706697
TaggedSource {
707-
underlying: Arc::new(RwLock::new(
708-
crate::core::hydroflow_crate::ports::TaggedSource {
709-
source: self.underlying.clone(),
710-
tag,
711-
},
712-
)),
698+
underlying: Arc::new(RwLock::new(core::hydroflow_crate::ports::TaggedSource {
699+
source: self.underlying.clone(),
700+
tag,
701+
})),
713702
}
714703
}
715704
}
716705

717706
#[pyclass(extends=HydroflowSink, subclass)]
718707
#[derive(Clone)]
719708
struct HydroflowNull {
720-
underlying: Arc<RwLock<crate::core::hydroflow_crate::ports::NullSourceSink>>,
709+
underlying: Arc<RwLock<core::hydroflow_crate::ports::NullSourceSink>>,
721710
}
722711

723712
#[pymethods]
@@ -731,21 +720,17 @@ impl HydroflowNull {
731720

732721
fn tagged(&self, tag: u32) -> TaggedSource {
733722
TaggedSource {
734-
underlying: Arc::new(RwLock::new(
735-
crate::core::hydroflow_crate::ports::TaggedSource {
736-
source: self.underlying.clone(),
737-
tag,
738-
},
739-
)),
723+
underlying: Arc::new(RwLock::new(core::hydroflow_crate::ports::TaggedSource {
724+
source: self.underlying.clone(),
725+
tag,
726+
})),
740727
}
741728
}
742729
}
743730

744731
#[pyfunction]
745732
fn null(py: Python<'_>) -> PyResult<Py<PyAny>> {
746-
let arc = Arc::new(RwLock::new(
747-
crate::core::hydroflow_crate::ports::NullSourceSink,
748-
));
733+
let arc = Arc::new(RwLock::new(core::hydroflow_crate::ports::NullSourceSink));
749734

750735
Ok(Py::new(
751736
py,

hydroflow/examples/kvs_bench/protocol/serialization/lattices/point.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::rc::Rc;
33

44
use lattices::Point;
55
use serde::de::{DeserializeSeed, Visitor};
6-
use serde::{Serialize, Serializer};
6+
use serde::{Deserializer, Serialize, Serializer};
77

88
use crate::buffer_pool::{AutoReturnBuffer, AutoReturnBufferDeserializer, BufferPool};
99

@@ -27,7 +27,7 @@ impl<'de, const SIZE: usize> DeserializeSeed<'de> for PointDeserializer<SIZE> {
2727

2828
fn deserialize<D>(self, deserializer: D) -> Result<Self::Value, D::Error>
2929
where
30-
D: serde::Deserializer<'de>,
30+
D: Deserializer<'de>,
3131
{
3232
struct V<const SIZE: usize> {
3333
pub collector: Rc<RefCell<BufferPool<SIZE>>>,
@@ -41,7 +41,7 @@ impl<'de, const SIZE: usize> DeserializeSeed<'de> for PointDeserializer<SIZE> {
4141

4242
fn visit_newtype_struct<D>(self, deserializer: D) -> Result<Self::Value, D::Error>
4343
where
44-
D: serde::Deserializer<'de>,
44+
D: Deserializer<'de>,
4545
{
4646
struct V<const SIZE: usize> {
4747
pub collector: Rc<RefCell<BufferPool<SIZE>>>,
@@ -58,9 +58,9 @@ impl<'de, const SIZE: usize> DeserializeSeed<'de> for PointDeserializer<SIZE> {
5858
deserializer: D,
5959
) -> Result<Self::Value, D::Error>
6060
where
61-
D: serde::Deserializer<'de>,
61+
D: Deserializer<'de>,
6262
{
63-
serde::de::DeserializeSeed::deserialize(
63+
DeserializeSeed::deserialize(
6464
AutoReturnBufferDeserializer {
6565
collector: self.collector,
6666
},

hydroflow/examples/kvs_bench/protocol/serialization/lattices/with_bot.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::rc::Rc;
33

44
use lattices::{Point, WithBot};
55
use serde::de::{DeserializeSeed, Visitor};
6-
use serde::{Serialize, Serializer};
6+
use serde::{Deserializer, Serialize, Serializer};
77

88
use super::point::PointWrapper;
99
use crate::buffer_pool::{AutoReturnBuffer, BufferPool};
@@ -35,7 +35,7 @@ impl<'de, const SIZE: usize> DeserializeSeed<'de> for WithBotDeserializer<SIZE>
3535

3636
fn deserialize<D>(self, deserializer: D) -> Result<Self::Value, D::Error>
3737
where
38-
D: serde::Deserializer<'de>,
38+
D: Deserializer<'de>,
3939
{
4040
struct V<const SIZE: usize> {
4141
pub collector: Rc<RefCell<BufferPool<SIZE>>>,
@@ -49,7 +49,7 @@ impl<'de, const SIZE: usize> DeserializeSeed<'de> for WithBotDeserializer<SIZE>
4949

5050
fn visit_some<D>(self, deserializer: D) -> Result<Self::Value, D::Error>
5151
where
52-
D: serde::Deserializer<'de>,
52+
D: Deserializer<'de>,
5353
{
5454
struct V<const SIZE: usize> {
5555
pub collector: Rc<RefCell<BufferPool<SIZE>>>,
@@ -66,9 +66,9 @@ impl<'de, const SIZE: usize> DeserializeSeed<'de> for WithBotDeserializer<SIZE>
6666
deserializer: D,
6767
) -> Result<Self::Value, D::Error>
6868
where
69-
D: serde::Deserializer<'de>,
69+
D: Deserializer<'de>,
7070
{
71-
serde::de::DeserializeSeed::deserialize(
71+
DeserializeSeed::deserialize(
7272
PointDeserializer {
7373
collector: self.collector,
7474
},

0 commit comments

Comments
 (0)