Skip to content

Commit 3fba85d

Browse files
committed
Derive Hash for Pos
So they can be used in `HashSet` and `HashMap` collections.
1 parent a1fb575 commit 3fba85d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/position.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::fmt;
22

33
/// Original position of element in source code
4-
#[derive(PartialOrd, Ord, PartialEq, Eq, Clone, Copy, Default)]
4+
#[derive(PartialOrd, Ord, PartialEq, Eq, Clone, Copy, Default, Hash)]
55
pub struct Pos {
66
/// One-based line number
77
pub line: usize,

0 commit comments

Comments
 (0)