feat(language): derive Clone and Copy on LanguageFn

Allows a LanguageFn to be passed around and create multiple languages since Language::new consumes a LanguageFn

LanguageFn just wraps a function pointer, which already conforms to Copy so this is a simple addition.
This commit is contained in:
Liam Rosenfeld 2024-09-02 21:12:17 -04:00 committed by GitHub
parent f48c210dbd
commit d60789afdc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,6 +1,7 @@
#![no_std]
/// LanguageFn wraps a C function that returns a pointer to a tree-sitter grammer.
#[repr(transparent)]
#[derive(Clone, Copy)]
pub struct LanguageFn(unsafe extern "C" fn() -> *const ());
impl LanguageFn {