Merge pull request #701 from smihica/add-i64-i32-cursor-type
Implemented CursorType for i32/i64
This commit is contained in:
commit
c9555a948c
@ -31,6 +31,30 @@ impl CursorType for usize {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl CursorType for i32 {
|
||||||
|
type Error = ParseIntError;
|
||||||
|
|
||||||
|
fn decode_cursor(s: &str) -> Result<Self, Self::Error> {
|
||||||
|
s.parse()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn encode_cursor(&self) -> String {
|
||||||
|
self.to_string()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl CursorType for i64 {
|
||||||
|
type Error = ParseIntError;
|
||||||
|
|
||||||
|
fn decode_cursor(s: &str) -> Result<Self, Self::Error> {
|
||||||
|
s.parse()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn encode_cursor(&self) -> String {
|
||||||
|
self.to_string()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl CursorType for String {
|
impl CursorType for String {
|
||||||
type Error = Infallible;
|
type Error = Infallible;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user