mirror of
				https://github.com/isar/rusqlite.git
				synced 2025-10-31 22:08:55 +08:00 
			
		
		
		
	Add FromSql for Box<str>, Rc<str> and Arc<str>
This commit is contained in:
		
				
					committed by
					
						 Thom Chiovoloni
						Thom Chiovoloni
					
				
			
			
				
	
			
			
			
						parent
						
							a788d40f10
						
					
				
				
					commit
					585797b4d6
				
			| @@ -166,6 +166,24 @@ impl FromSql for String { | |||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | impl FromSql for Box<str> { | ||||||
|  |     fn column_result(value: ValueRef<'_>) -> FromSqlResult<Self> { | ||||||
|  |         value.as_str().map(Into::into) | ||||||
|  |     } | ||||||
|  | } | ||||||
|  |  | ||||||
|  | impl FromSql for std::rc::Rc<str> { | ||||||
|  |     fn column_result(value: ValueRef<'_>) -> FromSqlResult<Self> { | ||||||
|  |         value.as_str().map(Into::into) | ||||||
|  |     } | ||||||
|  | } | ||||||
|  |  | ||||||
|  | impl FromSql for std::sync::Arc<str> { | ||||||
|  |     fn column_result(value: ValueRef<'_>) -> FromSqlResult<Self> { | ||||||
|  |         value.as_str().map(Into::into) | ||||||
|  |     } | ||||||
|  | } | ||||||
|  |  | ||||||
| impl FromSql for Vec<u8> { | impl FromSql for Vec<u8> { | ||||||
|     fn column_result(value: ValueRef<'_>) -> FromSqlResult<Self> { |     fn column_result(value: ValueRef<'_>) -> FromSqlResult<Self> { | ||||||
|         value.as_blob().map(|b| b.to_vec()) |         value.as_blob().map(|b| b.to_vec()) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user