From 3fba85d31198af39ffed726e2952bca56d0b5a73 Mon Sep 17 00:00:00 2001 From: David Pedersen Date: Thu, 2 May 2019 12:58:58 +0200 Subject: [PATCH] Derive `Hash` for `Pos` So they can be used in `HashSet` and `HashMap` collections. --- src/position.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/position.rs b/src/position.rs index 98ac28a..a3aaf12 100644 --- a/src/position.rs +++ b/src/position.rs @@ -1,7 +1,7 @@ use std::fmt; /// Original position of element in source code -#[derive(PartialOrd, Ord, PartialEq, Eq, Clone, Copy, Default)] +#[derive(PartialOrd, Ord, PartialEq, Eq, Clone, Copy, Default, Hash)] pub struct Pos { /// One-based line number pub line: usize,