Skip to content

Commit

Permalink
[web] Fix clippy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
feliwir committed Jan 16, 2025
1 parent f091018 commit 1ec9c6c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
12 changes: 6 additions & 6 deletions web/src/qido.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl QidoRequest {
}
}

pub async fn run(self: &Self) -> Result<Vec<InMemDicomObject>, DicomWebError> {
pub async fn run(&self) -> Result<Vec<InMemDicomObject>, DicomWebError> {
let mut query: Vec<(String, String)> = vec![];
if let Some(limit) = self.limit {
query.push((String::from("limit"), limit.to_string()));
Expand Down Expand Up @@ -99,27 +99,27 @@ impl QidoRequest {
.collect())
}

pub fn with_limit(self: &mut Self, limit: u32) -> &mut Self {
pub fn with_limit(&mut self, limit: u32) -> &mut Self {
self.limit = Some(limit);
self
}

pub fn with_offset(self: &mut Self, offset: u32) -> &mut Self {
pub fn with_offset(&mut self, offset: u32) -> &mut Self {
self.offset = Some(offset);
self
}

pub fn with_includefields(self: &mut Self, includefields: Vec<Tag>) -> &mut Self {
pub fn with_includefields(&mut self, includefields: Vec<Tag>) -> &mut Self {
self.includefields = includefields;
self
}

pub fn with_fuzzymatching(self: &mut Self, fuzzymatching: bool) -> &mut Self {
pub fn with_fuzzymatching(&mut self, fuzzymatching: bool) -> &mut Self {
self.fuzzymatching = Some(fuzzymatching);
self
}

pub fn with_filter(self: &mut Self, tag: Tag, value: String) -> &mut Self {
pub fn with_filter(&mut self, tag: Tag, value: String) -> &mut Self {
self.filters.push((tag, value));
self
}
Expand Down
13 changes: 6 additions & 7 deletions web/src/wado.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl WadoMetadataRequest {
WadoMetadataRequest { client, url }
}

pub async fn run(self: &Self) -> Result<Vec<InMemDicomObject>, DicomWebError> {
pub async fn run(&self) -> Result<Vec<InMemDicomObject>, DicomWebError> {
let request = self.client.client.get(&self.url);

// Basic authentication
Expand Down Expand Up @@ -85,7 +85,7 @@ impl WadoFileRequest {
WadoFileRequest { client, url }
}

pub async fn run(self: &Self) -> Result<Vec<FileDicomObject<InMemDicomObject>>, DicomWebError> {
pub async fn run(&self) -> Result<Vec<FileDicomObject<InMemDicomObject>>, DicomWebError> {
let request = self.client.client.get(&self.url);

// Basic authentication
Expand Down Expand Up @@ -163,12 +163,11 @@ pub struct WadoSingleFileRequest {
}

impl WadoSingleFileRequest {
pub async fn run(self: &Self) -> Result<FileDicomObject<InMemDicomObject>, DicomWebError> {
return self
.request
pub async fn run(&self) -> Result<FileDicomObject<InMemDicomObject>, DicomWebError> {
self.request
.run()
.await
.map(|mut v| v.pop().context(EmptyResponseSnafu))?;
.map(|mut v| v.pop().context(EmptyResponseSnafu))?
}
}

Expand All @@ -182,7 +181,7 @@ impl WadoFramesRequest {
WadoFramesRequest { client, url }
}

pub async fn run(self: &Self) -> Result<Vec<MultipartItem>, DicomWebError> {
pub async fn run(&self) -> Result<Vec<MultipartItem>, DicomWebError> {
let request = self.client.client.get(&self.url);

// Basic authentication
Expand Down

0 comments on commit 1ec9c6c

Please sign in to comment.