print used cache dir
All checks were successful
CI/CD Pipeline / test (push) Successful in 2m26s

This commit is contained in:
philipp 2024-05-26 12:20:19 +02:00
parent f567924a9e
commit 54d04625ca

View File

@ -14,17 +14,17 @@
// See the Licence for the specific language governing permissions and // See the Licence for the specific language governing permissions and
// limitations under the Licence. // limitations under the Licence.
use crate::law::ClassifierApplicable;
#[allow(clippy::wildcard_imports)] // I use *-operator on purpose: I want to receive a compiler #[allow(clippy::wildcard_imports)] // I use *-operator on purpose: I want to receive a compiler
// warning if I've not updated my `create_classifier` function // warning if I've not updated my `create_classifier` function
use crate::law::{self, responsible::*}; use crate::law::{self, responsible::*};
use crate::misc::Error; use crate::misc::Error;
use crate::paragraph::Parser; use crate::paragraph::Parser;
use crate::{law::ClassifierApplicable, misc};
use serde::Deserialize; use serde::Deserialize;
use std::fs; use std::fs;
use std::path::Path; use std::path::Path;
use std::sync::Arc; use std::sync::Arc;
use tracing::{event, instrument, Level}; use tracing::{event, info, instrument, Level};
// TODO: more generic // TODO: more generic
fn create_classifier(match_function: &str) -> Result<ClassifierApplicable, Error> { fn create_classifier(match_function: &str) -> Result<ClassifierApplicable, Error> {
@ -97,6 +97,8 @@ impl Config {
pub fn load<P: AsRef<Path> + std::fmt::Debug>( pub fn load<P: AsRef<Path> + std::fmt::Debug>(
path: P, path: P,
) -> Result<(usize, law::Builder, Parser), Error> { ) -> Result<(usize, law::Builder, Parser), Error> {
info!("Using cache dir: {}", misc::get_cache_dir().unwrap());
let config_str = fs::read_to_string(path)?; let config_str = fs::read_to_string(path)?;
let config: Config = toml::from_str(&config_str)?; let config: Config = toml::from_str(&config_str)?;