Skip to content

Commit 6442fa2

Browse files
committed
chore: docs and clippy
1 parent 179c9b2 commit 6442fa2

File tree

9 files changed

+17
-17
lines changed

9 files changed

+17
-17
lines changed

src/io/mzml/reader.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ impl<C: CentroidLike + BuildFromArrayMap, D: DeconvolutedCentroidLike + BuildFro
857857
dp_set = true;
858858
break;
859859
},
860-
Err(msg) => return Err(self.handle_xml_error(msg.into(), state))
860+
Err(msg) => return Err(self.handle_xml_error(msg, state))
861861
}
862862
}
863863
_ => {}
@@ -1732,7 +1732,7 @@ impl<
17321732
result.ok()
17331733
}
17341734

1735-
pub fn iter_chromatograms(&mut self) -> ChromatogramIter<R, C, D> {
1735+
pub fn iter_chromatograms(&mut self) -> ChromatogramIter<'_, R, C, D> {
17361736
ChromatogramIter::new(self)
17371737
}
17381738
}

src/io/mzml/writer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1754,7 +1754,7 @@ where
17541754
attrib!("encodedLength", encoded_len, outer);
17551755
if let Some(dp_id) = array.data_processing_reference() {
17561756
if let Some(dp_global) = self.run.default_data_processing_id.as_deref() {
1757-
if dp_id.as_ref() != dp_global {
1757+
if dp_id != dp_global {
17581758
attrib!("dataProcessingRef", dp_id, outer);
17591759
}
17601760
}

src/io/offset_index.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ impl OffsetIndex {
8282
}
8383

8484
/// Iterate over the keys and indices
85-
pub fn iter(&self) -> Iter<Box<str>, u64> {
85+
pub fn iter(&self) -> Iter<'_, Box<str>, u64> {
8686
self.offsets.iter()
8787
}
8888

src/io/traits/frame.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ pub trait IonMobilityFrameSource<
138138
}
139139

140140
/// Open a new iterator over this stream
141-
fn iter(&mut self) -> IonMobilityFrameIterator<C, D, S, Self>
141+
fn iter(&mut self) -> IonMobilityFrameIterator<'_, C, D, S, Self>
142142
where
143143
Self: Sized,
144144
{

src/params.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,7 +1208,7 @@ macro_rules! find_param_method {
12081208
};
12091209
($meth:ident, $curie:expr, $desc:literal) => {
12101210
#[doc=$desc]
1211-
pub fn $meth(&self) -> Option<$crate::params::ValueRef> {
1211+
pub fn $meth(&self) -> Option<$crate::params::ValueRef<'_>> {
12121212
self.get_param_by_curie($curie)
12131213
.map(|p| $crate::params::ParamLike::value(p))
12141214
}
@@ -1433,7 +1433,7 @@ pub fn curie_to_num(curie: &str) -> (Option<ControlledVocabulary>, Option<Access
14331433
/// Describe a controlled vocabulary parameter or a user-defined parameter
14341434
pub trait ParamLike {
14351435
fn name(&self) -> &str;
1436-
fn value(&self) -> ValueRef;
1436+
fn value(&self) -> ValueRef<'_>;
14371437
fn accession(&self) -> Option<AccessionIntCode>;
14381438
fn controlled_vocabulary(&self) -> Option<ControlledVocabulary>;
14391439
fn unit(&self) -> Unit;
@@ -2302,12 +2302,12 @@ pub trait ParamDescribed {
23022302
}
23032303

23042304
/// Iterate over the encapsulated parameter list
2305-
fn iter_params(&self) -> std::slice::Iter<Param> {
2305+
fn iter_params(&self) -> std::slice::Iter<'_, Param> {
23062306
self.params().iter()
23072307
}
23082308

23092309
/// Iterate mutably over the encapsulated parameter list
2310-
fn iter_params_mut(&mut self) -> std::slice::IterMut<Param> {
2310+
fn iter_params_mut(&mut self) -> std::slice::IterMut<'_, Param> {
23112311
self.params_mut().iter_mut()
23122312
}
23132313
}

src/spectrum/bindata/array.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -894,8 +894,8 @@ impl<'transient, 'lifespan: 'transient> DataArray {
894894
}
895895

896896
/// Get the identifier referencing a [`DataProcessing`](crate::meta::DataProcessing)
897-
pub fn data_processing_reference(&self) -> Option<&Box<str>> {
898-
self.data_processing_reference.as_ref()
897+
pub fn data_processing_reference(&self) -> Option<&str> {
898+
self.data_processing_reference.as_deref()
899899
}
900900

901901
/// Set the identifier referencing a [`DataProcessing`](crate::meta::DataProcessing)
@@ -927,7 +927,7 @@ impl<'transient, 'lifespan: 'transient> ByteArrayView<'transient, 'lifespan> for
927927
self.unit
928928
}
929929

930-
fn data_processing_reference(&self) -> Option<&Box<str>> {
930+
fn data_processing_reference(&self) -> Option<&str> {
931931
self.data_processing_reference()
932932
}
933933

@@ -996,7 +996,7 @@ impl<'transient, 'lifespan: 'transient> ByteArrayView<'transient, 'lifespan>
996996
self.source.name()
997997
}
998998

999-
fn data_processing_reference(&self) -> Option<&Box<str>> {
999+
fn data_processing_reference(&self) -> Option<&str> {
10001000
self.source.data_processing_reference()
10011001
}
10021002
}

src/spectrum/bindata/map.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl BinaryArrayMap {
4545
}
4646

4747
/// Iterate over references to the key-value pairs of this map
48-
pub fn iter(&self) -> Iter<ArrayType, DataArray> {
48+
pub fn iter(&self) -> Iter<'_, ArrayType, DataArray> {
4949
self.byte_buffer_map.iter()
5050
}
5151

@@ -55,7 +55,7 @@ impl BinaryArrayMap {
5555
}
5656

5757
/// Iterate over mutable references to the key-value pairs of this map
58-
pub fn iter_mut(&mut self) -> IterMut<ArrayType, DataArray> {
58+
pub fn iter_mut(&mut self) -> IterMut<'_, ArrayType, DataArray> {
5959
self.byte_buffer_map.iter_mut()
6060
}
6161

src/spectrum/bindata/traits.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ pub trait ByteArrayView<'transient, 'lifespan: 'transient> {
8080
fn unit(&self) -> Unit;
8181

8282
/// Get the identifier referencing a [`DataProcessing`](crate::meta::DataProcessing)
83-
fn data_processing_reference(&self) -> Option<&Box<str>> {
83+
fn data_processing_reference(&self) -> Option<&str> {
8484
None
8585
}
8686

src/spectrum/frame.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ pub trait IonMobilityFrameLike<
293293

294294
fn raw_arrays(&'_ self) -> Option<&'_ BinaryArrayMap3D>;
295295

296-
fn features(&self) -> RefFeatureDataLevel<C, D>;
296+
fn features(&self) -> RefFeatureDataLevel<'_, C, D>;
297297

298298
fn into_features_and_parts(self) -> (FeatureDataLevel<C, D>, IonMobilityFrameDescription);
299299
}

0 commit comments

Comments
 (0)