fn is_safe(&self, additional_safe_functions: &phf::Set<&'static str>) -> bool {
                // If this function is explicitly mentioned on the given include list, consider it
                // as safe.
                if additional_safe_functions.contains(self.name.to_string().as_str()) {
                    return true;
                }
                // If all parameters of this function are on a whitelist of "safe" types, consider
                // it as safe.
                self.signature.inputs.iter().all(|a| match &a.ty {
                    Type::Path(p) => {
                        let quoted = quote::quote! { #p };
                        let path_without_spaces = quoted.to_string().replace(" ", "");
                        SAFE_PARAM_TYPES.contains(path_without_spaces.as_str())
                    }
                    _ => false,
                })
            }
/// Returns if the function represented by this function pointer can be considered safe.
///
/// Is used for omitting the `unsafe` wherever possible.
Returns if the function represented by this function pointer can be considered safe.
Is used for omitting the `unsafe` wherever possible.
Returns if the function represented by this function pointer can be considered safe . Is used for omitting the ` unsafe ` wherever possible .
fn is_safe(&self, additional_safe_functions: &phf::Set<&'static str>) -> bool {
                // If this function is explicitly mentioned on the given include list, consider it
                // as safe.
                if additional_safe_functions.contains(self.name.to_string().as_str()) {
                    return true;
                }
                // If all parameters of this function are on a whitelist of "safe" types, consider
                // it as safe.
                self.signature.inputs.iter().all(|a| match &a.ty {
                    Type::Path(p) => {
                        let quoted = quote::quote! { #p };
                        let path_without_spaces = quoted.to_string().replace(" ", "");
                        SAFE_PARAM_TYPES.contains(path_without_spaces.as_str())
                    }
                    _ => false,
                })
            }
fn is_safe ( & self , additional_safe_functions : & phf :: Set < & ' static str > ) -> bool { // If this function is explicitly mentioned on the given include list, consider it // as safe. if additional_safe_functions . contains ( self . name . to_string ( ) . as_str ( ) ) { return true ; } // If all parameters of this function are on a whitelist of "safe" types, consider // it as safe. self . signature . inputs . iter ( ) . all ( | a | match & a . ty { Type :: Path ( p ) => { let quoted = quote :: quote ! { p } ; let path_without_spaces = quoted . to_string ( ) . replace ( " " , " " ) ; SAFE_PARAM_TYPES . contains ( path_without_spaces . as_str ( ) ) } _ => false , } ) }
Returns if the function represented by this function pointer can be considered safe.
Returns if the function represented by this function pointer can be considered safe .
&self
additional_safe_functions
&phf::Set<&'static str>
&self
additional_safe_functions
&phf::Set<&'static str>