diff --git a/src/analysis/special_functions.rs b/src/analysis/special_functions.rs index 9be927bc8..2344ebb7e 100644 --- a/src/analysis/special_functions.rs +++ b/src/analysis/special_functions.rs @@ -251,11 +251,8 @@ pub fn analyze_imports(specials: &Infos, imports: &mut Imports) { imports.add_with_version("glib::translate::*", info.version); } Compare => { - imports.add_with_version("std::cmp", info.version); imports.add_with_version("glib::translate::*", info.version); } - Display => imports.add_with_version("std::fmt", info.version), - Hash => imports.add_with_version("std::hash", info.version), Equal => imports.add_with_version("glib::translate::*", info.version), _ => {} } diff --git a/src/codegen/trait_impls.rs b/src/codegen/trait_impls.rs index 392f26a3c..0369b947e 100644 --- a/src/codegen/trait_impls.rs +++ b/src/codegen/trait_impls.rs @@ -140,9 +140,9 @@ fn generate_display( writeln!( w, "\ -impl fmt::Display for {type_name} {{ +impl std::fmt::Display for {type_name} {{ #[inline] - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {{ + fn fmt(&self, f: &mut fmt::Formatter) -> std::fmt::Result {{ {body} }} }}" @@ -168,9 +168,9 @@ fn generate_hash( writeln!( w, "\ -impl hash::Hash for {type_name} {{ +impl std::hash::Hash for {type_name} {{ #[inline] - fn hash(&self, state: &mut H) where H: hash::Hasher {{ + fn hash(&self, state: &mut H) where H: std::hash::Hasher {{ hash::Hash::hash(&{call}, state) }} }}" @@ -258,14 +258,14 @@ fn generate_ord( "\ impl PartialOrd for {type_name} {{ #[inline] - fn partial_cmp(&self, other: &Self) -> Option {{ + fn partial_cmp(&self, other: &Self) -> Option {{ {call}.partial_cmp(&0) }} }} impl Ord for {type_name} {{ #[inline] - fn cmp(&self, other: &Self) -> cmp::Ordering {{ + fn cmp(&self, other: &Self) -> std::cmp::Ordering {{ {call}.cmp(&0) }} }}"