From 3964651fc69cdf4ac060751464268fad41aca421 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Gaspard?= Date: Thu, 9 Feb 2023 03:35:42 +0100 Subject: [PATCH] Derive Hash for Language Given Language implements Eq, it can probably implement Hash too. This makes it easy to derive a random identifier from a `Language` --- lib/binding_rust/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/binding_rust/lib.rs b/lib/binding_rust/lib.rs index 870d177b..84471d06 100644 --- a/lib/binding_rust/lib.rs +++ b/lib/binding_rust/lib.rs @@ -38,7 +38,7 @@ pub const PARSER_HEADER: &'static str = include_str!("../include/tree_sitter/par /// An opaque object that defines how to parse a particular language. The code for each /// `Language` is generated by the Tree-sitter CLI. #[doc(alias = "TSLanguage")] -#[derive(Clone, Copy, Debug, PartialEq, Eq)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] #[repr(transparent)] pub struct Language(*const ffi::TSLanguage);