minhash_rs/
primitive.rs

1pub trait Primitive<T> {
2    fn convert(self) -> T;
3}
4
5impl Primitive<u8> for u8 {
6    fn convert(self) -> u8 {
7        self
8    }
9}
10
11impl Primitive<u16> for u8 {
12    fn convert(self) -> u16 {
13        self as u16
14    }
15}
16
17impl Primitive<u32> for u8 {
18    fn convert(self) -> u32 {
19        self as u32
20    }
21}
22
23impl Primitive<u64> for u8 {
24    fn convert(self) -> u64 {
25        self as u64
26    }
27}
28
29impl Primitive<usize> for u8 {
30    fn convert(self) -> usize {
31        self as usize
32    }
33}
34
35impl Primitive<u8> for u16 {
36    fn convert(self) -> u8 {
37        self as u8
38    }
39}
40
41impl Primitive<u16> for u16 {
42    fn convert(self) -> u16 {
43        self
44    }
45}
46
47impl Primitive<u32> for u16 {
48    fn convert(self) -> u32 {
49        self as u32
50    }
51}
52
53impl Primitive<u64> for u16 {
54    fn convert(self) -> u64 {
55        self as u64
56    }
57}
58
59impl Primitive<usize> for u16 {
60    fn convert(self) -> usize {
61        self as usize
62    }
63}
64
65impl Primitive<u8> for u32 {
66    fn convert(self) -> u8 {
67        self as u8
68    }
69}
70
71impl Primitive<u16> for u32 {
72    fn convert(self) -> u16 {
73        self as u16
74    }
75}
76
77impl Primitive<u32> for u32 {
78    fn convert(self) -> u32 {
79        self
80    }
81}
82
83impl Primitive<u64> for u32 {
84    fn convert(self) -> u64 {
85        self as u64
86    }
87}
88
89impl Primitive<usize> for u32 {
90    fn convert(self) -> usize {
91        self as usize
92    }
93}
94
95impl Primitive<u8> for u64 {
96    fn convert(self) -> u8 {
97        self as u8
98    }
99}
100
101impl Primitive<u16> for u64 {
102    fn convert(self) -> u16 {
103        self as u16
104    }
105}
106
107impl Primitive<u32> for u64 {
108    fn convert(self) -> u32 {
109        self as u32
110    }
111}
112
113impl Primitive<u64> for u64 {
114    fn convert(self) -> u64 {
115        self
116    }
117}
118
119impl Primitive<usize> for u64 {
120    fn convert(self) -> usize {
121        self as usize
122    }
123}
124
125impl Primitive<u8> for usize {
126    fn convert(self) -> u8 {
127        self as u8
128    }
129}
130
131impl Primitive<u16> for usize {
132    fn convert(self) -> u16 {
133        self as u16
134    }
135}
136
137impl Primitive<u32> for usize {
138    fn convert(self) -> u32 {
139        self as u32
140    }
141}
142
143impl Primitive<u64> for usize {
144    fn convert(self) -> u64 {
145        self as u64
146    }
147}
148
149impl Primitive<usize> for usize {
150    fn convert(self) -> usize {
151        self
152    }
153}