diff --git a/src/cache.rs b/src/cache.rs index c3ad91f..2284f60 100644 --- a/src/cache.rs +++ b/src/cache.rs @@ -61,8 +61,8 @@ fn establish_connection() -> Result { Ok(PgConnection::establish(&database_url)?) } -/// Load data from the cache, and return a vector of Cache. -fn load_sql() -> Result, CacheError> { +/// Read data from the cache, and return a vector of Cache. +fn read_sql() -> Result, CacheError> { let connection = &mut establish_connection()?; let results = cache.filter(name.eq("Debian")).load::(connection)?; @@ -88,7 +88,8 @@ fn insert_sql(conn: &mut PgConnection, new_name: &str, new_domain: &str, new_ip: /// SQL cache function to be called by `get_data` (read) and `api_client` (write). pub fn sql_cache() { let connection = &mut establish_connection().unwrap(); - let data = match load_sql() { + + let data = match read_sql() { Ok(data) => data, Err(err) => { eprintln!("Unable to load data: {err}");