From 1f228c9248b2fa74fb6f473f703ea80d4bcda009 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20MARTIN?= <maelle.martin@proton.me> Date: Mon, 9 Dec 2024 15:15:22 +0100 Subject: [PATCH] RUST: Update & fix some warnings given by rust --- src/Rust/Cargo.lock | 73 +++++++++++------------ src/Rust/vvs_font/src/error.rs | 3 + src/Rust/vvs_font/src/font.rs | 70 ++++++++++------------ src/Rust/vvs_lang/src/error_report.rs | 2 +- src/Rust/vvs_lang/src/symbol_table.rs | 2 +- src/Rust/vvs_lib/src/lib.rs | 5 +- src/Rust/vvs_llvm/src/bindings/builder.rs | 2 +- src/Rust/vvs_llvm/src/bindings/jit.rs | 2 +- src/Rust/vvs_parser/src/ast/options.rs | 4 +- src/Rust/vvs_parser/src/node.rs | 2 +- src/Rust/vvs_runtime_types/src/mangle.rs | 2 +- src/Rust/vvs_runtime_types/src/vvll.rs | 28 ++++++--- src/Rust/vvs_xdg/src/config.rs | 4 +- src/Rust/vvs_xdg/src/paths.rs | 10 +--- 14 files changed, 105 insertions(+), 104 deletions(-) diff --git a/src/Rust/Cargo.lock b/src/Rust/Cargo.lock index f3b6289e..7c1fc712 100644 --- a/src/Rust/Cargo.lock +++ b/src/Rust/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "ab_glyph" @@ -90,9 +90,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.93" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" +checksum = "c1fd03a028ef38ba2276dce7e33fcd6369c158a1bca17946c4b1b701891c1ff7" [[package]] name = "approx" @@ -194,9 +194,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.2" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f34d93e62b03caf570cccc334cbc6c2fceca82f39211051345108adcba3eebdc" +checksum = "27f657647bcff5394bf56c7317665bbf790a137a50eaaa5c6bfbb9e27a518f2d" dependencies = [ "shlex", ] @@ -242,9 +242,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.21" +version = "4.5.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb3b4b9e5a7c7514dfa52869339ee98b3156b0bfb4e8a77c4ff4babb64b1604f" +checksum = "3135e7ec2ef7b10c6ed8950f0f792ed96ee093fa088608f1c76e569722700c84" dependencies = [ "clap_builder", "clap_derive", @@ -252,9 +252,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.21" +version = "4.5.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b17a95aa67cc7b5ebd32aa5370189aa0d79069ef1c64ce893bd30fb24bff20ec" +checksum = "30582fc632330df2bd26877bde0c1f4470d57c582bbc070376afcd04d8cb4838" dependencies = [ "anstream", "anstyle", @@ -286,9 +286,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afb84c814227b90d6895e01398aee0d8033c00e7466aca416fb6a8e0eb19d8a7" +checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" [[package]] name = "clap_mangen" @@ -551,9 +551,9 @@ checksum = "dd2e7510819d6fbf51a5545c8f922716ecfb14df168a3242f7d33e0239efe6a1" [[package]] name = "fastrand" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "fnv" @@ -713,9 +713,9 @@ checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "js-sys" -version = "0.3.74" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a865e038f7f6ed956f788f0d7d60c541fff74c7bd74272c5d4cf15c63743e705" +checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" dependencies = [ "once_cell", "wasm-bindgen", @@ -729,9 +729,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.167" +version = "0.2.168" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" +checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" [[package]] name = "linked-hash-map" @@ -1092,15 +1092,15 @@ checksum = "88f8660c1ff60292143c98d08fc6e2f654d722db50410e3f3797d40baaf9d8f3" [[package]] name = "rustix" -version = "0.38.41" +version = "0.38.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" +checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" dependencies = [ "bitflags", "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1332,18 +1332,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.4" +version = "2.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f49a1853cf82743e3b7950f77e0f4d622ca36cf4317cba00c767838bac8d490" +checksum = "8fec2a1820ebd077e2b90c4df007bebf344cd394098a13c563957d0afc83ea47" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "2.0.4" +version = "2.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8381894bb3efe0c4acac3ded651301ceee58a15d47c2e34885ed1908ad667061" +checksum = "d65750cab40f4ff1929fb1ba509e9914eb756131cef4210da8d5d700d26f6312" dependencies = [ "proc-macro2", "quote", @@ -1667,9 +1667,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.97" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d15e63b4482863c109d70a7b8706c1e364eb6ea449b201a76c5b89cedcec2d5c" +checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" dependencies = [ "cfg-if", "once_cell", @@ -1678,13 +1678,12 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.97" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d36ef12e3aaca16ddd3f67922bc63e48e953f126de60bd33ccc0101ef9998cd" +checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" dependencies = [ "bumpalo", "log", - "once_cell", "proc-macro2", "quote", "syn 2.0.90", @@ -1693,9 +1692,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.97" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "705440e08b42d3e4b36de7d66c944be628d579796b8090bfa3471478a2260051" +checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1703,9 +1702,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.97" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98c9ae5a76e46f4deecd0f0255cc223cfa18dc9b261213b8aa0c7b36f61b3f1d" +checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" dependencies = [ "proc-macro2", "quote", @@ -1716,15 +1715,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.97" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ee99da9c5ba11bd675621338ef6fa52296b76b83305e9b6e5c77d4c286d6d49" +checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" [[package]] name = "web-sys" -version = "0.3.74" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a98bc3c33f0fe7e59ad7cd041b89034fa82a7c2d4365ca538dda6cdaf513863c" +checksum = "04dd7223427d52553d3702c004d3b2fe07c148165faa56313cb00211e31c12bc" dependencies = [ "js-sys", "wasm-bindgen", diff --git a/src/Rust/vvs_font/src/error.rs b/src/Rust/vvs_font/src/error.rs index 00d4c894..b7fc2308 100644 --- a/src/Rust/vvs_font/src/error.rs +++ b/src/Rust/vvs_font/src/error.rs @@ -17,6 +17,9 @@ pub enum FontError { #[error("failed to outline glyph '{1}' for size {0}pt")] FailedToOutline(f64, char), + #[error("failed to scale glyph '{1}' for size {0}pt")] + FailedToScale(f64, char), + #[error("can't outline an empty string")] EmptyStringToOutline, } diff --git a/src/Rust/vvs_font/src/font.rs b/src/Rust/vvs_font/src/font.rs index fe18a2ee..c38700d8 100644 --- a/src/Rust/vvs_font/src/font.rs +++ b/src/Rust/vvs_font/src/font.rs @@ -41,12 +41,10 @@ impl<'a> TryFrom<&'a [u8]> for Font<'a> { } } -impl<'a> Font<'a> { +impl Font<'_> { /// Get the general name of the font. pub fn name(&self) -> Result<String, FontError> { - self.face - .names() - .into_iter() + (self.face.names().into_iter()) .find(|name| name.name_id == ttf_parser::name_id::FAMILY && name.is_unicode()) .and_then(|name| name.to_string()) .ok_or(FontError::NoName) @@ -56,8 +54,7 @@ impl<'a> Font<'a> { pub fn family_names(&self) -> Vec<String> { let names = self.face.names(); let filter = [ttf_parser::name_id::POST_SCRIPT_NAME, ttf_parser::name_id::FULL_NAME]; - names - .into_iter() + (names.into_iter()) .flat_map(|name| (filter.contains(&name.name_id) && name.is_unicode()).then(|| name.to_string())) .flatten() .collect() @@ -65,23 +62,25 @@ impl<'a> Font<'a> { /// The the font types. pub fn font_types(&self) -> Vec<FontType> { - use FontType::*; + let face = &self.face; + let mut ret = [ - self.face.is_regular().then_some(Regular), - self.face.is_italic().then_some(Italic), - self.face.is_bold().then_some(Bold), - self.face.is_oblique().then_some(Oblique), - self.face.is_monospaced().then_some(Monospaced), - self.face.is_variable().then_some(Variable), + face.is_regular().then_some(FontType::Regular), + face.is_italic().then_some(FontType::Italic), + face.is_bold().then_some(FontType::Bold), + face.is_oblique().then_some(FontType::Oblique), + face.is_monospaced().then_some(FontType::Monospaced), + face.is_variable().then_some(FontType::Variable), ] .into_iter() .flatten() .chain(Some(match self.face.style() { - ttf_parser::Style::Normal => Regular, - ttf_parser::Style::Italic => Italic, - ttf_parser::Style::Oblique => Oblique, + ttf_parser::Style::Normal => FontType::Regular, + ttf_parser::Style::Italic => FontType::Italic, + ttf_parser::Style::Oblique => FontType::Oblique, })) .collect::<Vec<_>>(); + ret.sort(); ret.dedup(); ret @@ -95,35 +94,30 @@ impl<'a> Font<'a> { /// Outline a glyph with the specified pt size. pub fn outline_glyph(&self, pt: f64, glyph: char) -> Result<Rect, FontError> { - self.font - .outline_glyph( - self.font.glyph_id(glyph).with_scale( - self.font - .pt_to_px_scale(f64::clamp(pt, f32::MIN.into(), f32::MAX.into()) as f32) - .expect("failed to get the px_scale..."), - ), - ) - .map(|outlined| { - let ab_glyph::Rect { min, max } = outlined.px_bounds(); - Rect::new( - Point { x: min.x.trunc() as i64, y: min.y.trunc() as i64 }, - Point { x: max.x.trunc() as i64, y: max.y.trunc() as i64 }, - ) - }) - .ok_or(FontError::FailedToOutline(pt, glyph)) + let scaled_glyph = self.font.glyph_id(glyph).with_scale( + self.font + .pt_to_px_scale(f64::clamp(pt, f32::MIN.into(), f32::MAX.into()) as f32) + .ok_or(FontError::FailedToScale(pt, glyph))?, + ); + let ab_glyph::Rect { min, max } = self + .font + .outline_glyph(scaled_glyph) + .ok_or(FontError::FailedToOutline(pt, glyph))? + .px_bounds(); + Ok(Rect::new( + Point { x: min.x.trunc() as i64, y: min.y.trunc() as i64 }, + Point { x: max.x.trunc() as i64, y: max.y.trunc() as i64 }, + )) } /// Outline a string slice with the specified pt size. pub fn outline_str(&self, pt: f64, str: impl AsRef<str>) -> Result<Rect, FontError> { - let (rects, errs): (Vec<_>, Vec<_>) = str + let mut rects = str .as_ref() .chars() .map(|glyph| self.outline_glyph(pt, glyph)) - .partition(Result::is_ok); - if let Some(err) = errs.into_iter().next() { - return err; - } - let mut rects = rects.into_iter().map(Result::unwrap); + .collect::<Result<Vec<_>, _>>()? + .into_iter(); let first = rects.next().ok_or(FontError::EmptyStringToOutline)?; Ok(rects.fold(first, Rect::merge)) } diff --git a/src/Rust/vvs_lang/src/error_report.rs b/src/Rust/vvs_lang/src/error_report.rs index fcf28839..48e687e4 100644 --- a/src/Rust/vvs_lang/src/error_report.rs +++ b/src/Rust/vvs_lang/src/error_report.rs @@ -126,7 +126,7 @@ impl ErrorReport<'_> { } } -impl<'a> Default for ErrorReport<'a> { +impl Default for ErrorReport<'_> { fn default() -> Self { Self { files: SimpleFiles::new(), messages: Default::default(), id_cache: Default::default() } } diff --git a/src/Rust/vvs_lang/src/symbol_table.rs b/src/Rust/vvs_lang/src/symbol_table.rs index efe1a97e..bc03ab54 100644 --- a/src/Rust/vvs_lang/src/symbol_table.rs +++ b/src/Rust/vvs_lang/src/symbol_table.rs @@ -99,7 +99,7 @@ impl<'a, T: Clone> SymbolTable<'a, T, SymbolTableMutable> { } } -impl<'a, T: Clone, State> SymbolTable<'a, T, State> { +impl<T: Clone, State> SymbolTable<'_, T, State> { /// Get a variable/callback/function from this scope or any parent scope. pub fn get(&self, symbol: impl AsRef<str>) -> Option<&T> { self.symbols diff --git a/src/Rust/vvs_lib/src/lib.rs b/src/Rust/vvs_lib/src/lib.rs index e1e35aa4..2ebb398a 100644 --- a/src/Rust/vvs_lib/src/lib.rs +++ b/src/Rust/vvs_lib/src/lib.rs @@ -37,10 +37,7 @@ impl<'a> StringSlice<'a> { } } -impl<'a, S> From<S> for StringSlice<'a> -where - S: AsRef<str>, -{ +impl<S: AsRef<str>> From<S> for StringSlice<'_> { #[inline] fn from(value: S) -> Self { let value = value.as_ref(); diff --git a/src/Rust/vvs_llvm/src/bindings/builder.rs b/src/Rust/vvs_llvm/src/bindings/builder.rs index 37d48232..6eaf94c9 100644 --- a/src/Rust/vvs_llvm/src/bindings/builder.rs +++ b/src/Rust/vvs_llvm/src/bindings/builder.rs @@ -17,7 +17,7 @@ macro_rules! build { }; } -impl<'a> Builder<'a> { +impl Builder<'_> { /// Create a new builder. pub fn new(ctx: &Context) -> Self { unsafe { Self::from_ptr(LLVMCreateBuilderInContext(ctx.as_ptr())) } diff --git a/src/Rust/vvs_llvm/src/bindings/jit.rs b/src/Rust/vvs_llvm/src/bindings/jit.rs index 29506a04..76ad8f54 100644 --- a/src/Rust/vvs_llvm/src/bindings/jit.rs +++ b/src/Rust/vvs_llvm/src/bindings/jit.rs @@ -67,7 +67,7 @@ impl JIT { let es = LLVMOrcLLJITGetExecutionSession(jit); let objl = LLVMOrcCreateRTDyldObjectLinkingLayerWithSectionMemoryManager(es); let irtl = LLVMOrcLLJITGetIRTransformLayer(jit); - let dylib = LLVMOrcExecutionSessionCreateBareJITDylib(es, b"<main>\0".as_ptr() as *const _); + let dylib = LLVMOrcExecutionSessionCreateBareJITDylib(es, c"<main>".as_ptr()); // Allow to search for symbols in the current process, only if they start with `VVRT`. let mut dg = ptr::null_mut(); diff --git a/src/Rust/vvs_parser/src/ast/options.rs b/src/Rust/vvs_parser/src/ast/options.rs index f7b6f730..84c127d9 100644 --- a/src/Rust/vvs_parser/src/ast/options.rs +++ b/src/Rust/vvs_parser/src/ast/options.rs @@ -70,7 +70,7 @@ impl<'a> OptionTableSectionMut<'a> { } } -impl<'a> Iterator for OptionTableSectionMut<'a> { +impl Iterator for OptionTableSectionMut<'_> { type Item = (ShortString, Expression); fn next(&mut self) -> Option<Self::Item> { @@ -78,7 +78,7 @@ impl<'a> Iterator for OptionTableSectionMut<'a> { } } -impl<'a> Extend<(ShortString, Expression)> for OptionTableSectionMut<'a> { +impl Extend<(ShortString, Expression)> for OptionTableSectionMut<'_> { fn extend<T: IntoIterator<Item = (ShortString, Expression)>>(&mut self, iter: T) { self.options.extend(iter) } diff --git a/src/Rust/vvs_parser/src/node.rs b/src/Rust/vvs_parser/src/node.rs index dfe90349..e00139d2 100644 --- a/src/Rust/vvs_parser/src/node.rs +++ b/src/Rust/vvs_parser/src/node.rs @@ -84,7 +84,7 @@ impl<'a> Iterator for Tokens<'a> { } } -impl<'a> DoubleEndedIterator for Tokens<'a> { +impl DoubleEndedIterator for Tokens<'_> { fn next_back(&mut self) -> Option<Self::Item> { if self.items.is_empty() { return None; diff --git a/src/Rust/vvs_runtime_types/src/mangle.rs b/src/Rust/vvs_runtime_types/src/mangle.rs index 9e3bb2a5..2a857708 100644 --- a/src/Rust/vvs_runtime_types/src/mangle.rs +++ b/src/Rust/vvs_runtime_types/src/mangle.rs @@ -86,7 +86,7 @@ impl<'a> VVRTSymbol<'a> { } } -impl<'a> std::fmt::Display for VVRTSymbol<'a> { +impl std::fmt::Display for VVRTSymbol<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { let Self { sym, module, name, .. } = self; match sym { diff --git a/src/Rust/vvs_runtime_types/src/vvll.rs b/src/Rust/vvs_runtime_types/src/vvll.rs index 5d38dffe..5fb849dd 100644 --- a/src/Rust/vvs_runtime_types/src/vvll.rs +++ b/src/Rust/vvs_runtime_types/src/vvll.rs @@ -1,7 +1,10 @@ #![allow(non_snake_case)] use hashbrown::HashSet; -use std::sync::OnceLock; +use std::{ + borrow::Borrow, + sync::{OnceLock, RwLock}, +}; use vvs_llvm::sys::*; #[derive(Debug, Clone, Copy, PartialEq, Eq)] @@ -26,11 +29,22 @@ pub trait LLVMExported { /// - All the managed types must have been exported into at least one module /// - This function is not thread-safe pub unsafe fn LLVMTypeIsManaged(ty: LLVMTypeRef) -> bool { - managed_types().contains(&ty) -} + /// Don't use this, just to allow for [LLVMTypeIsManaged] to exists… + #[derive(Eq, PartialEq, Hash)] + struct LLVMTypeRefWrapper(LLVMTypeRef); + + unsafe impl Send for LLVMTypeRefWrapper {} + unsafe impl Sync for LLVMTypeRefWrapper {} + impl Borrow<LLVMTypeRef> for LLVMTypeRefWrapper { + fn borrow(&self) -> &LLVMTypeRef { + &self.0 + } + } + + static MANAGED_TYPES: OnceLock<RwLock<HashSet<LLVMTypeRefWrapper>>> = OnceLock::new(); -unsafe fn managed_types() -> &'static mut HashSet<LLVMTypeRef> { - static mut MANAGED_TYPES: OnceLock<HashSet<LLVMTypeRef>> = OnceLock::new(); - MANAGED_TYPES.get_or_init(HashSet::new); - MANAGED_TYPES.get_mut().expect(" should have been created") + MANAGED_TYPES + .get_or_init(RwLock::default) + .read() + .map_or(false, |types| types.contains(&ty)) } diff --git a/src/Rust/vvs_xdg/src/config.rs b/src/Rust/vvs_xdg/src/config.rs index c1652221..21c2e470 100644 --- a/src/Rust/vvs_xdg/src/config.rs +++ b/src/Rust/vvs_xdg/src/config.rs @@ -199,7 +199,7 @@ impl<'a, Format: XDGConfigFileSerde, Merged: private_merged::Sealed> XDGConfig<' } } -impl<'a, Format: XDGConfigFileSerde + Default, Merged: private_merged::Sealed> XDGConfig<'a, Format, Merged> { +impl<Format: XDGConfigFileSerde + Default, Merged: private_merged::Sealed> XDGConfig<'_, Format, Merged> { /// Try to read the config files and deserialize them. If an error is encountred at any point, /// log it and return the provided default if the merge was not silent, skip the file if it was /// silent. If needed the default value is written on the disk, note that this operation may @@ -213,7 +213,7 @@ impl<'a, Format: XDGConfigFileSerde + Default, Merged: private_merged::Sealed> X } } -impl<'a, Format: XDGConfigFileSerde> XDGConfig<'a, Format, XDGConfigFirst> { +impl<Format: XDGConfigFileSerde> XDGConfig<'_, Format, XDGConfigFirst> { /// Write a value to the default config file location, the one with the higher priority /// (usually the user's one) fn write(&self, value: &Format) -> Result<(), XDGError> { diff --git a/src/Rust/vvs_xdg/src/paths.rs b/src/Rust/vvs_xdg/src/paths.rs index 326348c0..64e7d8f5 100644 --- a/src/Rust/vvs_xdg/src/paths.rs +++ b/src/Rust/vvs_xdg/src/paths.rs @@ -150,20 +150,14 @@ impl<'a> std::iter::Extend<&'a MaybeFolderList> for MaybeFolderList { } } -impl<'a, S> From<S> for MaybeFolderList -where - S: AsRef<str> + 'a, -{ +impl<S: AsRef<str>> From<S> for MaybeFolderList { #[inline] fn from(value: S) -> Self { MaybeFolderList::Folder(PathBuf::from(value.as_ref())) } } -impl<'a, P> FromIterator<P> for MaybeFolderList -where - P: AsRef<Path> + 'a, -{ +impl<P: AsRef<Path>> FromIterator<P> for MaybeFolderList { #[inline] fn from_iter<T: IntoIterator<Item = P>>(iter: T) -> Self { let mut folders = iter.into_iter(); -- GitLab