fix for review

This commit is contained in:
qdequele
2020-01-29 18:30:21 +01:00
parent 14b5fc4d6c
commit a5b0e468ee
48 changed files with 558 additions and 1216 deletions

View File

@ -22,14 +22,6 @@ impl IndexedPos {
pub const fn max() -> IndexedPos {
IndexedPos(u16::max_value())
}
pub fn next(self) -> SResult<IndexedPos> {
self.0.checked_add(1).map(IndexedPos).ok_or(Error::MaxFieldsLimitExceeded)
}
pub fn prev(self) -> SResult<IndexedPos> {
self.0.checked_sub(1).map(IndexedPos).ok_or(Error::MaxFieldsLimitExceeded)
}
}
impl From<u16> for IndexedPos {
@ -44,7 +36,6 @@ impl Into<u16> for IndexedPos {
}
}
#[derive(Serialize, Deserialize, Debug, Copy, Clone, Default, PartialOrd, Ord, PartialEq, Eq, Hash)]
pub struct FieldId(pub u16);
@ -64,10 +55,6 @@ impl FieldId {
pub fn next(self) -> SResult<FieldId> {
self.0.checked_add(1).map(FieldId).ok_or(Error::MaxFieldsLimitExceeded)
}
pub fn prev(self) -> SResult<FieldId> {
self.0.checked_sub(1).map(FieldId).ok_or(Error::MaxFieldsLimitExceeded)
}
}
impl From<u16> for FieldId {