|
@@ -13,7 +13,7 @@ impl<T: crate::model::Entity + crate::model::Entity> WithID<T> {
|
|
|
fn wrap(what: T, raw_id: i64) -> Self {
|
|
|
Self {
|
|
|
wrap: what,
|
|
|
- id: ID { 0: raw_id },
|
|
|
+ id: ID(raw_id)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -26,7 +26,7 @@ impl<T: crate::model::Entity + crate::model::Entity> WithID<T> {
|
|
|
|
|
|
impl<T: crate::model::Entity + crate::model::Entity> AsRef<T> for WithID<T> {
|
|
|
fn as_ref(&self) -> &T {
|
|
|
- return &self.wrap;
|
|
|
+ &self.wrap
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -90,7 +90,7 @@ pub fn add<T: crate::model::Entity + serde::Serialize>(db: &DB, m: &T) -> Option
|
|
|
assert_eq!(row.len(), <T as crate::model::Entity>::column_count());
|
|
|
|
|
|
let id = prepared.insert(rusqlite::params_from_iter(row)).ok()?;
|
|
|
- Some(ID { 0: id })
|
|
|
+ Some(ID(id))
|
|
|
}
|
|
|
|
|
|
pub struct Context<'a> {
|