mirror of
				https://github.com/isar/rusqlite.git
				synced 2025-10-31 05:48:56 +08:00 
			
		
		
		
	Reduce required lifetime in create_scalar_function
This commit is contained in:
		
				
					committed by
					
						 Thom Chiovoloni
						Thom Chiovoloni
					
				
			
			
				
	
			
			
			
						parent
						
							b0ade73f43
						
					
				
				
					commit
					749266cae9
				
			| @@ -334,15 +334,15 @@ impl Connection { | ||||
|     /// # Failure | ||||
|     /// | ||||
|     /// Will return Err if the function could not be attached to the connection. | ||||
|     pub fn create_scalar_function<F, T>( | ||||
|         &self, | ||||
|     pub fn create_scalar_function<'a, F, T>( | ||||
|         &'a self, | ||||
|         fn_name: &str, | ||||
|         n_arg: c_int, | ||||
|         flags: FunctionFlags, | ||||
|         x_func: F, | ||||
|     ) -> Result<()> | ||||
|     where | ||||
|         F: FnMut(&Context<'_>) -> Result<T> + Send + UnwindSafe + 'static, | ||||
|         F: FnMut(&Context<'_>) -> Result<T> + Send + UnwindSafe + 'a, | ||||
|         T: ToSql, | ||||
|     { | ||||
|         self.db | ||||
| @@ -411,15 +411,15 @@ impl Connection { | ||||
| } | ||||
|  | ||||
| impl InnerConnection { | ||||
|     fn create_scalar_function<F, T>( | ||||
|         &mut self, | ||||
|     fn create_scalar_function<'a, F, T>( | ||||
|         &'a mut self, | ||||
|         fn_name: &str, | ||||
|         n_arg: c_int, | ||||
|         flags: FunctionFlags, | ||||
|         x_func: F, | ||||
|     ) -> Result<()> | ||||
|     where | ||||
|         F: FnMut(&Context<'_>) -> Result<T> + Send + UnwindSafe + 'static, | ||||
|         F: FnMut(&Context<'_>) -> Result<T> + Send + UnwindSafe + 'a, | ||||
|         T: ToSql, | ||||
|     { | ||||
|         unsafe extern "C" fn call_boxed_closure<F, T>( | ||||
|   | ||||
		Reference in New Issue
	
	Block a user