diff --git a/examples/compare.rs b/examples/compare.rs index e28f827d770a5b9647a436eea0cd46841ee3150d..8365ad4b6b59c485d003c415d31bfb1625d89135 100644 --- a/examples/compare.rs +++ b/examples/compare.rs @@ -1,4 +1,4 @@ -extern crate lcms2; + use lcms2::*; use std::env; diff --git a/examples/gamma.rs b/examples/gamma.rs index 8a9eff4fe4a8ff61eaf2a0132f76d07cd98e6955..eff6ee18d4ac944e445690330bf436b28a49ee76 100644 --- a/examples/gamma.rs +++ b/examples/gamma.rs @@ -1,4 +1,4 @@ -extern crate lcms2; + use lcms2::*; #[repr(C)] diff --git a/examples/tags.rs b/examples/tags.rs index cf9d9f9681524c3cef0af93c964770ffed1ff2c5..1d9d83e66e43c6ba02125974ce473e9045a092e7 100644 --- a/examples/tags.rs +++ b/examples/tags.rs @@ -1,4 +1,4 @@ -extern crate lcms2; + use lcms2::*; use std::env; diff --git a/examples/thread.rs b/examples/thread.rs index bf81f923f4cb5550d34643d32a60ada216f57bb4..cbcfb725c5d216aca85e29196ffeadd6613f6a88 100644 --- a/examples/thread.rs +++ b/examples/thread.rs @@ -1,4 +1,4 @@ -extern crate lcms2; + use lcms2::*; use std::thread; @@ -31,5 +31,5 @@ fn main() { let sync = Transform::new_flags_context(ThreadContext::new(), &profile, PixelFormat::RGB_8, &profile, PixelFormat::RGB_8, Intent::Saturation, Flags::NO_CACHE).unwrap(); let out = [0u8; 3]; sync.transform_pixels(&[[1u8,2,3]], &mut [out]); - let _: Box<Sync> = Box::new(sync); + let _: Box<dyn Sync> = Box::new(sync); } diff --git a/src/error.rs b/src/error.rs index 5b3343ed841ad4c8d289205012f41bb439340dce..86f93fd6aed427417b9f2ebb71edbe31ee361fc0 100644 --- a/src/error.rs +++ b/src/error.rs @@ -23,7 +23,7 @@ impl Error { pub type LCMSResult<T> = Result<T, Error>; impl fmt::Display for Error { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_str(self.description()) } } diff --git a/src/locale.rs b/src/locale.rs index edc25e5aef58555e3889040510bd4346c45811ce..16ecce45b0e90757034c535409dc067c5c8eb772 100644 --- a/src/locale.rs +++ b/src/locale.rs @@ -66,13 +66,13 @@ impl Default for Locale { } impl fmt::Debug for Locale { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { <Locale as fmt::Display>::fmt(self, f) } } impl fmt::Display for Locale { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { for &c in self.language.iter().take_while(|&&c| c != 0) { f.write_char(c as u8 as char)?; } diff --git a/src/mlu.rs b/src/mlu.rs index f3646c76370db6a38b4402b9c77b01eea0b18e1d..890992972e7bf73661f81fe115e6b0d3767d0bf4 100644 --- a/src/mlu.rs +++ b/src/mlu.rs @@ -146,7 +146,7 @@ impl MLURef { } impl fmt::Debug for MLURef { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let t = self.text(Locale::none()); write!(f, "MLU({:?} {:?})", if let Ok(ref t) = t { &t } else { "None" }, self.tanslations()) } diff --git a/src/namedcolorlist.rs b/src/namedcolorlist.rs index 34b4f8ed7bf6b161435bb2e8455f3e832e7ad945..12d1c7eccda13dbd3330b36de004192b50a1ed62 100644 --- a/src/namedcolorlist.rs +++ b/src/namedcolorlist.rs @@ -93,7 +93,7 @@ impl NamedColorListRef { } impl<'a> fmt::Debug for NamedColorListRef { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { if let Some(c) = self.get(0) { write!(f, "NamedColorList({} colors: {}{}{}, etc.)", self.len(), c.prefix, c.name, c.suffix) } else { diff --git a/src/pipeline.rs b/src/pipeline.rs index 040253e25e570d8577e402a129d8c4de29ae7067..63065290106201ef47a18f3c398fd358f6d60253 100644 --- a/src/pipeline.rs +++ b/src/pipeline.rs @@ -56,7 +56,7 @@ impl PipelineRef { } } - pub fn stages(&self) -> StagesIter { + pub fn stages(&self) -> StagesIter<'_> { StagesIter(self.first_stage()) } @@ -89,7 +89,7 @@ impl PipelineRef { } impl fmt::Debug for PipelineRef { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "Pipeline({}->{}ch, {} stages)", self.input_channels(), self.output_channels(), self.stage_count()) } } diff --git a/src/profile.rs b/src/profile.rs index de29608e90418d7e6d79c0f21ea453739aa99218..377d8855ab1198c149c934083d812812346d095e 100644 --- a/src/profile.rs +++ b/src/profile.rs @@ -331,11 +331,11 @@ impl<Ctx: Context> Profile<Ctx> { unsafe { ffi::cmsIsTag(self.handle, sig) != 0 } } - pub fn read_tag(&self, sig: TagSignature) -> Tag { + pub fn read_tag(&self, sig: TagSignature) -> Tag<'_> { unsafe { Tag::new(sig, ffi::cmsReadTag(self.handle, sig) as *const u8) } } - pub fn write_tag(&mut self, sig: TagSignature, tag: Tag) -> bool { + pub fn write_tag(&mut self, sig: TagSignature, tag: Tag<'_>) -> bool { unsafe { ffi::cmsWriteTag(self.handle, sig, tag.data_for_signature(sig) as *const _) != 0 } diff --git a/src/stage.rs b/src/stage.rs index 6bbf6a65efbe08985d05955594790b3365b7d9ac..fdc25e0d53658ea265d48f66c172f99c9ccc5366 100644 --- a/src/stage.rs +++ b/src/stage.rs @@ -109,7 +109,7 @@ impl<'a> Iterator for StagesIter<'a> { } impl fmt::Debug for StageRef { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "Stage({:?})", self.stage_type()) } } diff --git a/src/tonecurve.rs b/src/tonecurve.rs index b8ee265d05e796b9fb94ed2f234e585963647911..09d164c7311882dc827b89dd426194d8320f1cbb 100644 --- a/src/tonecurve.rs +++ b/src/tonecurve.rs @@ -151,7 +151,7 @@ impl ToneCurveRef { } impl fmt::Debug for ToneCurveRef { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "ToneCurve({} entries, gamma ~{:.1})", self.estimated_entries().len(), self.estimated_gamma(1.).unwrap_or(0.)) } } diff --git a/src/transform.rs b/src/transform.rs index 51fe584da7e394af21f4418d837aeb41ed9d23fe..c2ea8189d9b2e19dd5f92adb9cadb8d242fdf9fe 100644 --- a/src/transform.rs +++ b/src/transform.rs @@ -131,7 +131,7 @@ impl<InputPixelFormat: Copy + Clone, OutputPixelFormat: Copy + Clone, Ctx: Conte Err(Error::ObjectCreationError) } else { Ok(Transform { - handle: handle, + handle, _from: Self::check_format::<InputPixelFormat>(in_format, true), _to: Self::check_format::<OutputPixelFormat>(out_format, false), _context_ref: PhantomData, diff --git a/tests/transform.rs b/tests/transform.rs index abcea484e8425d6d09935398ecae65b3e4ad6ee7..4b5a24c1a770f42c20b42b7040345f2c486acc94 100644 --- a/tests/transform.rs +++ b/tests/transform.rs @@ -1,4 +1,4 @@ -extern crate lcms2; + use lcms2::*; const PROFILE: &'static [u8] = include_bytes!("tinysrgb.icc");