Skip to content

Commit 3964651

Browse files
authored
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`
1 parent 5766b8a commit 3964651

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/binding_rust/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub const PARSER_HEADER: &'static str = include_str!("../include/tree_sitter/par
3838
/// An opaque object that defines how to parse a particular language. The code for each
3939
/// `Language` is generated by the Tree-sitter CLI.
4040
#[doc(alias = "TSLanguage")]
41-
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41+
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
4242
#[repr(transparent)]
4343
pub struct Language(*const ffi::TSLanguage);
4444

0 commit comments

Comments
 (0)