From 7de7e53436df4f5abf131870a1f02f2d91379bf3 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Thu, 5 Aug 2021 20:42:41 +0200 Subject: refactor: merge getters for faculties and spaces options --- src/browser/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/browser/mod.rs') diff --git a/src/browser/mod.rs b/src/browser/mod.rs index 1f44493..82c9c60 100644 --- a/src/browser/mod.rs +++ b/src/browser/mod.rs @@ -1,6 +1,6 @@ use std::collections::HashMap; -use self::web_browser::{Browser, WEB_BROWSER}; +use self::web_browser::{Browser, ROOMS_URL, WEB_BROWSER}; use crate::Config; use thirtyfour::prelude::WebDriverResult; @@ -27,7 +27,7 @@ pub async unsafe fn login(credentials: &Config) -> WebDriverResult<()> { /// Get the faculties available for booking a room pub async unsafe fn get_faculties() -> WebDriverResult>> { if let Some(driver) = &WEB_BROWSER { - if let Some(faculties) = driver.faculties().await? { + if let Some(faculties) = driver.get_options("dipartimento", ROOMS_URL).await? { return Ok(Some(faculties)); } } @@ -38,7 +38,7 @@ pub async unsafe fn get_faculties() -> WebDriverResult WebDriverResult>> { if let Some(driver) = &WEB_BROWSER { - if let Some(spaces) = driver.spaces().await? { + if let Some(spaces) = driver.get_options("space", "").await? { return Ok(Some(spaces)); } } -- cgit v1.2.3-18-g5258