From 2f9f18b80a9e2134f674f345e48a5f21de5efadd Mon Sep 17 00:00:00 2001 From: FxQnLr Date: Sun, 18 Feb 2024 21:16:46 +0100 Subject: Refactor stuff. Use Postgres Types --- src/db.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/db.rs') diff --git a/src/db.rs b/src/db.rs index 489a000..47e907d 100644 --- a/src/db.rs +++ b/src/db.rs @@ -1,13 +1,13 @@ use serde::Serialize; -use sqlx::{PgPool, postgres::PgPoolOptions}; +use sqlx::{PgPool, postgres::PgPoolOptions, types::{ipnetwork::IpNetwork, mac_address::MacAddress}}; use tracing::{debug, info}; #[derive(Serialize, Debug)] pub struct Device { pub id: String, - pub mac: String, + pub mac: MacAddress, pub broadcast_addr: String, - pub ip: String, + pub ip: IpNetwork, pub times: Option> } -- cgit v1.2.3