From 915ce3ebed7a9840e02657486cb7ddff3db9c439 Mon Sep 17 00:00:00 2001 From: Amit Upadhyay Date: Sat, 4 Nov 2023 17:38:41 +0530 Subject: [PATCH] removed some Config::read() calls --- fastn-core/src/apis/cache.rs | 12 +++-- fastn-core/src/apis/clone.rs | 9 ++-- fastn-core/src/apis/cr.rs | 18 +++---- fastn-core/src/apis/edit.rs | 31 ++++-------- fastn-core/src/apis/edit_source.rs | 13 ++++-- fastn-core/src/apis/sync.rs | 13 +++--- fastn-core/src/apis/sync2.rs | 13 +++--- fastn-core/src/apis/view_source.rs | 13 ++++-- fastn-core/src/commands/serve.rs | 75 +++++++++++++++++------------- fastn-core/src/lib.rs | 2 +- 10 files changed, 100 insertions(+), 99 deletions(-) diff --git a/fastn-core/src/apis/cache.rs b/fastn-core/src/apis/cache.rs index 53a9e6c07c..d98b0fbe14 100644 --- a/fastn-core/src/apis/cache.rs +++ b/fastn-core/src/apis/cache.rs @@ -38,7 +38,10 @@ fn query(uri: &str) -> fastn_core::Result { }) } -pub async fn clear(req: &fastn_core::http::Request) -> fastn_core::http::Response { +pub async fn clear( + config: &fastn_core::Config, + req: &fastn_core::http::Request, +) -> fastn_core::http::Response { let query = match query(req.uri()) { Ok(q) => q, Err(err) => { @@ -50,7 +53,7 @@ pub async fn clear(req: &fastn_core::http::Request) -> fastn_core::http::Respons } }; - if let Err(err) = clear_(&query, req).await { + if let Err(err) = clear_(config, &query, req).await { return fastn_core::server_error!( "fastn-Error: /-/clear-cache/, query: {:?}, error: {:?}", query, @@ -62,11 +65,10 @@ pub async fn clear(req: &fastn_core::http::Request) -> fastn_core::http::Respons } pub async fn clear_( + config: &fastn_core::Config, query: &QueryParams, _req: &fastn_core::http::Request, ) -> fastn_core::Result<()> { - let config = - fastn_core::time("Config::read()").it(fastn_core::Config::read(None, false).await?); if config.package.download_base_url.is_none() { return Err(fastn_core::Error::APIResponseError( "cannot remove anything, package does not have `download_base_url`".to_string(), @@ -111,7 +113,7 @@ pub async fn clear_( // Download FASTN.ftd again after removing all the content if !config.root.join("FASTN.ftd").exists() { - fastn_core::commands::serve::download_init_package(config.package.download_base_url) + fastn_core::commands::serve::download_init_package(&config.package.download_base_url) .await?; } diff --git a/fastn-core/src/apis/clone.rs b/fastn-core/src/apis/clone.rs index 103ccba1ce..a678f16d46 100644 --- a/fastn-core/src/apis/clone.rs +++ b/fastn-core/src/apis/clone.rs @@ -5,20 +5,17 @@ pub struct CloneResponse { pub reserved_crs: Vec, } -pub async fn clone( - req: fastn_core::http::Request, -) -> fastn_core::Result { +pub async fn clone(config: &fastn_core::Config) -> fastn_core::Result { // TODO: implement authentication - match clone_worker(req).await { + match clone_worker(config).await { Ok(data) => fastn_core::http::api_ok(data), Err(err) => fastn_core::http::api_error(err.to_string()), } } -async fn clone_worker(_req: fastn_core::http::Request) -> fastn_core::Result { +async fn clone_worker(config: &fastn_core::Config) -> fastn_core::Result { use itertools::Itertools; - let config = fastn_core::Config::read(None, false).await?; let all_files = config .get_all_file_path(&config.package, Default::default())? .into_iter() diff --git a/fastn-core/src/apis/cr.rs b/fastn-core/src/apis/cr.rs index 7b131387ce..1aa2644591 100644 --- a/fastn-core/src/apis/cr.rs +++ b/fastn-core/src/apis/cr.rs @@ -4,10 +4,10 @@ pub struct CreateCRRequest { } pub async fn create_cr( - req: &fastn_core::http::Request, + config: &fastn_core::Config, cr_req: CreateCRRequest, ) -> fastn_core::Result { - match create_cr_worker(req, cr_req).await { + match create_cr_worker(config, cr_req).await { Ok(cr_number) => { #[derive(serde::Serialize)] struct CreateCRResponse { @@ -21,10 +21,9 @@ pub async fn create_cr( } async fn create_cr_worker( - _req: &fastn_core::http::Request, + config: &fastn_core::Config, cr_request: CreateCRRequest, ) -> fastn_core::Result { - let config = fastn_core::Config::read(None, false).await?; let cr_number = config.extract_cr_number().await?; let default_title = format!("CR#{cr_number}"); let cr_meta = fastn_core::cr::CRMeta { @@ -32,24 +31,25 @@ async fn create_cr_worker( cr_number: cr_number as usize, open: true, }; - fastn_core::commands::create_cr::add_cr_to_workspace(&config, &cr_meta).await?; + fastn_core::commands::create_cr::add_cr_to_workspace(config, &cr_meta).await?; Ok(cr_number as usize) } pub async fn create_cr_page( + config: &fastn_core::Config, req: fastn_core::http::Request, ) -> fastn_core::Result { - match create_cr_page_worker(req).await { + match create_cr_page_worker(config, req).await { Ok(body) => Ok(body), Err(err) => fastn_core::http::api_error(err.to_string()), } } async fn create_cr_page_worker( + config: &fastn_core::Config, req: fastn_core::http::Request, ) -> fastn_core::Result { - let config = fastn_core::Config::read(None, false).await?; - let create_cr_ftd = fastn_core::package_info_create_cr(&config)?; + let create_cr_ftd = fastn_core::package_info_create_cr(config)?; let main_document = fastn_core::Document { id: "create-cr.ftd".to_string(), @@ -59,7 +59,7 @@ async fn create_cr_page_worker( }; let mut req_config = - fastn_core::RequestConfig::new(&config, &req, main_document.id.as_str(), "/"); + fastn_core::RequestConfig::new(config, &req, main_document.id.as_str(), "/"); fastn_core::package::package_doc::read_ftd(&mut req_config, &main_document, "/", false, false) .await diff --git a/fastn-core/src/apis/edit.rs b/fastn-core/src/apis/edit.rs index 75f3ae04b6..f46f3e77e4 100644 --- a/fastn-core/src/apis/edit.rs +++ b/fastn-core/src/apis/edit.rs @@ -25,14 +25,11 @@ pub struct EditResponse { } pub async fn edit( + config: &fastn_core::Config, req: &fastn_core::http::Request, req_data: EditRequest, ) -> fastn_core::Result { - let config = match fastn_core::Config::read(None, false).await { - Ok(config) => config, - Err(err) => return fastn_core::http::api_error(err.to_string()), - }; - let mut req_config = fastn_core::RequestConfig::new(&config, req, "edit.ftd", "/"); + let mut req_config = fastn_core::RequestConfig::new(config, req, "edit.ftd", "/"); req_config.current_document = Some(req_data.path.to_string()); match req_config.can_write(req_data.path.as_str()).await { @@ -60,7 +57,7 @@ pub async fn edit( } pub(crate) async fn edit_worker( - config: fastn_core::Config, + config: &fastn_core::Config, request: EditRequest, ) -> fastn_core::Result { if request.is_delete() { @@ -111,7 +108,7 @@ pub(crate) async fn edit_worker( .await { let snapshots = fastn_core::snapshot::get_latest_snapshots(&config.root).await?; - let workspaces = fastn_core::snapshot::get_workspace(&config).await?; + let workspaces = fastn_core::snapshot::get_workspace(config).await?; let file = fastn_core::get_file( config.package.name.to_string(), @@ -150,7 +147,7 @@ pub(crate) async fn edit_worker( if let Some(before_update_status) = before_update_status { let snapshots = fastn_core::snapshot::get_latest_snapshots(&config.root).await?; - let workspaces = fastn_core::snapshot::get_workspace(&config).await?; + let workspaces = fastn_core::snapshot::get_workspace(config).await?; let file = fastn_core::get_file( config.package.name.to_string(), &config.root.join(&file_name), @@ -175,13 +172,8 @@ pub(crate) async fn edit_worker( }) } -pub async fn sync() -> fastn_core::Result { - let config = match fastn_core::Config::read(None, false).await { - Ok(config) => config, - Err(err) => return fastn_core::http::api_error(err.to_string()), - }; - - match fastn_core::commands::sync::sync(&config, None).await { +pub async fn sync(config: &fastn_core::Config) -> fastn_core::Result { + match fastn_core::commands::sync::sync(config, None).await { Ok(_) => { #[derive(serde::Serialize)] struct SyncResponse { @@ -199,15 +191,10 @@ pub struct RevertRequest { } pub async fn revert( - _req: &fastn_core::http::Request, + config: &fastn_core::Config, rev: RevertRequest, ) -> fastn_core::Result { - let config = match fastn_core::Config::read(None, false).await { - Ok(config) => config, - Err(err) => return fastn_core::http::api_error(err.to_string()), - }; - - match fastn_core::commands::revert::revert(&config, rev.path.as_str()).await { + match fastn_core::commands::revert::revert(config, rev.path.as_str()).await { Ok(_) => { #[derive(serde::Serialize)] struct RevertResponse { diff --git a/fastn-core/src/apis/edit_source.rs b/fastn-core/src/apis/edit_source.rs index ad3f060bd4..cb93e8edba 100644 --- a/fastn-core/src/apis/edit_source.rs +++ b/fastn-core/src/apis/edit_source.rs @@ -1,4 +1,7 @@ -pub(crate) async fn edit_source(req: &fastn_core::http::Request) -> fastn_core::http::Response { +pub(crate) async fn edit_source( + config: &fastn_core::Config, + req: &fastn_core::http::Request, +) -> fastn_core::http::Response { // TODO: Need to remove unwrap let path = { let mut path: camino::Utf8PathBuf = @@ -9,7 +12,7 @@ pub(crate) async fn edit_source(req: &fastn_core::http::Request) -> fastn_core:: path }; - match handle_view_source(req, path.as_str()).await { + match handle_view_source(config, req, path.as_str()).await { Ok(body) => fastn_core::http::ok(body), Err(e) => { fastn_core::server_error!("new_path: {}, Error: {:?}", path, e) @@ -18,18 +21,18 @@ pub(crate) async fn edit_source(req: &fastn_core::http::Request) -> fastn_core:: } async fn handle_view_source( + config: &fastn_core::Config, req: &fastn_core::http::Request, path: &str, ) -> fastn_core::Result> { - let config = fastn_core::Config::read(None, false).await?; - let mut req_config = fastn_core::RequestConfig::new(&config, req, "editor-source.ftd", "/"); + let mut req_config = fastn_core::RequestConfig::new(config, req, "editor-source.ftd", "/"); let file_name = config.get_file_path_and_resolve(path).await?; let file = req_config.get_file_and_package_by_id(path).await?; match file { fastn_core::File::Ftd(_) | fastn_core::File::Markdown(_) | fastn_core::File::Code(_) => { - let editor_ftd = fastn_core::package_editor_source(&config, file_name.as_str())?; + let editor_ftd = fastn_core::package_editor_source(config, file_name.as_str())?; let main_document = fastn_core::Document { id: "editor-source.ftd".to_string(), content: editor_ftd, diff --git a/fastn-core/src/apis/sync.rs b/fastn-core/src/apis/sync.rs index f8475a79be..617c3d2163 100644 --- a/fastn-core/src/apis/sync.rs +++ b/fastn-core/src/apis/sync.rs @@ -63,25 +63,24 @@ pub struct SyncRequest { /// If conflict occur, Then send back updated version in latest.ftd with conflicted content /// pub async fn sync( - req: &fastn_core::http::Request, + config: &fastn_core::Config, sync_req: SyncRequest, ) -> fastn_core::Result { dbg!("remote server call", &sync_req.package_name); - match sync_worker(req, sync_req).await { + match sync_worker(config, sync_req).await { Ok(data) => fastn_core::http::api_ok(data), Err(err) => fastn_core::http::api_error(err.to_string()), } } pub(crate) async fn sync_worker( - _req: &fastn_core::http::Request, + config: &fastn_core::Config, request: SyncRequest, ) -> fastn_core::Result { use itertools::Itertools; // TODO: Need to call at once only - let config = fastn_core::Config::read(None, false).await?; let mut snapshots = fastn_core::snapshot::get_latest_snapshots(&config.root).await?; let client_snapshots = fastn_core::snapshot::resolve_snapshots(&request.latest_ftd).await?; // let latest_ftd = tokio::fs::read_to_string(config.history_dir().join(".latest.ftd")).await?; @@ -229,12 +228,12 @@ pub(crate) async fn sync_worker( } } - client_current_files(&config, &snapshots, &client_snapshots, &mut synced_files).await?; + client_current_files(config, &snapshots, &client_snapshots, &mut synced_files).await?; - let history_files = clone_history_files(&config, &snapshots, &client_snapshots).await?; + let history_files = clone_history_files(config, &snapshots, &client_snapshots).await?; fastn_core::snapshot::create_latest_snapshots( - &config, + config, &snapshots .into_iter() .map(|(filename, timestamp)| fastn_core::Snapshot { diff --git a/fastn-core/src/apis/sync2.rs b/fastn-core/src/apis/sync2.rs index f21ace4003..a6d2524c05 100644 --- a/fastn-core/src/apis/sync2.rs +++ b/fastn-core/src/apis/sync2.rs @@ -110,12 +110,12 @@ pub struct File { } pub async fn sync2( - req: &fastn_core::http::Request, + config: &fastn_core::Config, sync_req: SyncRequest, ) -> fastn_core::Result { dbg!("remote server call", &sync_req.package_name); - match sync_worker(req, sync_req).await { + match sync_worker(config, sync_req).await { Ok(data) => fastn_core::http::api_ok(data), Err(err) => fastn_core::http::api_error(err.to_string()), } @@ -308,14 +308,13 @@ pub(crate) async fn do_sync( } pub(crate) async fn sync_worker( - _req: &fastn_core::http::Request, + config: &fastn_core::Config, request: SyncRequest, ) -> fastn_core::Result { use itertools::Itertools; // TODO: Need to call at once only - let config = fastn_core::Config::read(None, false).await?; - let mut synced_files = do_sync(&config, request.files.as_slice()).await?; + let mut synced_files = do_sync(config, request.files.as_slice()).await?; let remote_history = config.get_history().await?; let remote_manifest = fastn_core::history::FileHistory::get_remote_manifest(remote_history.as_slice(), true)?; @@ -324,9 +323,9 @@ pub(crate) async fn sync_worker( let client_latest = fastn_core::history::FileHistory::get_remote_manifest(clone_history.as_slice(), true)?; - client_current_files(&config, &remote_manifest, &client_latest, &mut synced_files).await?; + client_current_files(config, &remote_manifest, &client_latest, &mut synced_files).await?; - let history_files = clone_history_files(&config, &remote_manifest, &client_latest).await?; + let history_files = clone_history_files(config, &remote_manifest, &client_latest).await?; Ok(SyncResponse { files: synced_files.into_values().collect_vec(), diff --git a/fastn-core/src/apis/view_source.rs b/fastn-core/src/apis/view_source.rs index bba3dcd823..90a866982d 100644 --- a/fastn-core/src/apis/view_source.rs +++ b/fastn-core/src/apis/view_source.rs @@ -1,4 +1,7 @@ -pub(crate) async fn view_source(req: &fastn_core::http::Request) -> fastn_core::http::Response { +pub(crate) async fn view_source( + config: &fastn_core::Config, + req: &fastn_core::http::Request, +) -> fastn_core::http::Response { // TODO: Need to remove unwrap let path = { let mut path: camino::Utf8PathBuf = @@ -9,7 +12,7 @@ pub(crate) async fn view_source(req: &fastn_core::http::Request) -> fastn_core:: path }; - match handle_view_source(req, path.as_str()).await { + match handle_view_source(config, req, path.as_str()).await { Ok(body) => fastn_core::http::ok(body), Err(e) => { fastn_core::server_error!("new_path: {}, Error: {:?}", path, e) @@ -18,11 +21,11 @@ pub(crate) async fn view_source(req: &fastn_core::http::Request) -> fastn_core:: } async fn handle_view_source( + config: &fastn_core::Config, req: &fastn_core::http::Request, path: &str, ) -> fastn_core::Result> { - let config = fastn_core::Config::read(None, false).await?; - let mut req_config = fastn_core::RequestConfig::new(&config, req, "editor.ftd", "/"); + let mut req_config = fastn_core::RequestConfig::new(config, req, "editor.ftd", "/"); let file_name = config.get_file_path_and_resolve(path).await?; let file = req_config.get_file_and_package_by_id(path).await?; @@ -30,7 +33,7 @@ async fn handle_view_source( fastn_core::File::Ftd(_) | fastn_core::File::Markdown(_) | fastn_core::File::Code(_) => { let snapshots = fastn_core::snapshot::get_latest_snapshots(&config.root).await?; let diff = get_diff(&file, &snapshots).await; - let editor_ftd = fastn_core::package_info_editor(&config, file_name.as_str(), diff)?; + let editor_ftd = fastn_core::package_info_editor(config, file_name.as_str(), diff)?; let main_document = fastn_core::Document { id: "editor.ftd".to_string(), content: editor_ftd, diff --git a/fastn-core/src/commands/serve.rs b/fastn-core/src/commands/serve.rs index be55481be9..4caba15e82 100644 --- a/fastn-core/src/commands/serve.rs +++ b/fastn-core/src/commands/serve.rs @@ -383,9 +383,9 @@ pub async fn serve( }) } -pub(crate) async fn download_init_package(url: Option) -> std::io::Result<()> { +pub(crate) async fn download_init_package(url: &Option) -> std::io::Result<()> { let mut package = fastn_core::Package::new("unknown-package"); - package.download_base_url = url; + package.download_base_url = url.to_owned(); package .http_download_by_id( "FASTN.ftd", @@ -400,6 +400,7 @@ pub(crate) async fn download_init_package(url: Option) -> std::io::Resul } pub async fn clear_cache( + config: &fastn_core::Config, req: fastn_core::http::Request, ) -> fastn_core::Result { fn is_login(req: &fastn_core::http::Request) -> bool { @@ -416,7 +417,7 @@ pub async fn clear_cache( let from = actix_web::web::Query::::from_query(req.query_string())?; if from.from.eq(&Some("temp-github".to_string())) { let _lock = LOCK.write().await; - return Ok(fastn_core::apis::cache::clear(&req).await); + return Ok(fastn_core::apis::cache::clear(config, &req).await); } // TODO: Remove After Demo, till here @@ -430,7 +431,7 @@ pub async fn clear_cache( } let _lock = LOCK.write().await; - fastn_core::apis::cache::clear(&req).await; + fastn_core::apis::cache::clear(config, &req).await; // TODO: Redirect to Referrer uri return Ok(actix_web::HttpResponse::Found() .append_header((actix_web::http::header::LOCATION, "/".to_string())) @@ -438,70 +439,80 @@ pub async fn clear_cache( } // TODO: Move them to routes folder -async fn sync(req: fastn_core::http::Request) -> fastn_core::Result { +async fn sync( + config: &fastn_core::Config, + req: fastn_core::http::Request, +) -> fastn_core::Result { let _lock = LOCK.write().await; - fastn_core::apis::sync(&req, req.json()?).await + fastn_core::apis::sync(config, req.json()?).await } -async fn sync2(req: fastn_core::http::Request) -> fastn_core::Result { +async fn sync2( + config: &fastn_core::Config, + req: fastn_core::http::Request, +) -> fastn_core::Result { let _lock = LOCK.write().await; - fastn_core::apis::sync2(&req, req.json()?).await + fastn_core::apis::sync2(config, req.json()?).await } -pub async fn clone( - req: fastn_core::http::Request, -) -> fastn_core::Result { +pub async fn clone(config: &fastn_core::Config) -> fastn_core::Result { let _lock = LOCK.read().await; - fastn_core::apis::clone(req).await + fastn_core::apis::clone(config).await } pub(crate) async fn view_source( + config: &fastn_core::Config, req: fastn_core::http::Request, ) -> fastn_core::Result { let _lock = LOCK.read().await; - Ok(fastn_core::apis::view_source(&req).await) + Ok(fastn_core::apis::view_source(config, &req).await) } pub(crate) async fn edit_source( + config: &fastn_core::Config, req: fastn_core::http::Request, ) -> fastn_core::Result { let _lock = LOCK.read().await; - Ok(fastn_core::apis::edit_source(&req).await) + Ok(fastn_core::apis::edit_source(config, &req).await) } pub async fn edit( + config: &fastn_core::Config, req: fastn_core::http::Request, ) -> fastn_core::Result { let _lock = LOCK.write().await; - fastn_core::apis::edit(&req, req.json()?).await + fastn_core::apis::edit(config, &req, req.json()?).await } pub async fn revert( + config: &fastn_core::Config, req: fastn_core::http::Request, ) -> fastn_core::Result { let _lock = LOCK.write().await; - fastn_core::apis::edit::revert(&req, req.json()?).await + fastn_core::apis::edit::revert(config, req.json()?).await } pub async fn editor_sync( - _req: fastn_core::http::Request, + config: &fastn_core::Config, ) -> fastn_core::Result { let _lock = LOCK.write().await; - fastn_core::apis::edit::sync().await + fastn_core::apis::edit::sync(config).await } pub async fn create_cr( + config: &fastn_core::Config, req: fastn_core::http::Request, ) -> fastn_core::Result { let _lock = LOCK.write().await; - fastn_core::apis::cr::create_cr(&req, req.json()?).await + fastn_core::apis::cr::create_cr(config, req.json()?).await } pub async fn create_cr_page( + config: &fastn_core::Config, req: fastn_core::http::Request, ) -> fastn_core::Result { let _lock = LOCK.read().await; - fastn_core::apis::cr::create_cr_page(req).await + fastn_core::apis::cr::create_cr_page(config, req).await } struct AppData { @@ -621,18 +632,18 @@ async fn actual_route( let req = fastn_core::http::Request::from_actix(req, body); match (req.method().to_lowercase().as_str(), req.path()) { - ("post", "/-/sync/") if cfg!(feature = "remote") => sync(req).await, - ("post", "/-/sync2/") if cfg!(feature = "remote") => sync2(req).await, - ("get", "/-/clone/") if cfg!(feature = "remote") => clone(req).await, - ("get", t) if t.starts_with("/-/view-src/") => view_source(req).await, - ("get", t) if t.starts_with("/-/edit-src/") => edit_source(req).await, + ("post", "/-/sync/") if cfg!(feature = "remote") => sync(config, req).await, + ("post", "/-/sync2/") if cfg!(feature = "remote") => sync2(config, req).await, + ("get", "/-/clone/") if cfg!(feature = "remote") => clone(config).await, + ("get", t) if t.starts_with("/-/view-src/") => view_source(config, req).await, + ("get", t) if t.starts_with("/-/edit-src/") => edit_source(config, req).await, ("get", t) if t.starts_with("/-/auth/") => fastn_core::auth::routes::handle_auth(req).await, - ("post", "/-/edit/") => edit(req).await, - ("post", "/-/revert/") => revert(req).await, - ("get", "/-/editor-sync/") => editor_sync(req).await, - ("post", "/-/create-cr/") => create_cr(req).await, - ("get", "/-/create-cr-page/") => create_cr_page(req).await, - ("get", "/-/clear-cache/") => clear_cache(req).await, + ("post", "/-/edit/") => edit(config, req).await, + ("post", "/-/revert/") => revert(config, req).await, + ("get", "/-/editor-sync/") => editor_sync(config).await, + ("post", "/-/create-cr/") => create_cr(config, req).await, + ("get", "/-/create-cr-page/") => create_cr_page(config, req).await, + ("get", "/-/clear-cache/") => clear_cache(config, req).await, ("get", "/-/poll/") => fastn_core::watcher::poll().await, ("get", "/favicon.ico") => favicon().await, ("get", "/test/") => test().await, @@ -678,7 +689,7 @@ pub async fn listen( env_logger::init_from_env(env_logger::Env::new().default_filter_or("info")); if package_download_base_url.is_some() { - download_init_package(package_download_base_url).await?; + download_init_package(&package_download_base_url).await?; } if cfg!(feature = "controller") { diff --git a/fastn-core/src/lib.rs b/fastn-core/src/lib.rs index 15e4f28694..91360f3e27 100644 --- a/fastn-core/src/lib.rs +++ b/fastn-core/src/lib.rs @@ -57,7 +57,7 @@ pub(crate) use package::Package; pub(crate) use snapshot::Snapshot; pub(crate) use tracker::Track; pub(crate) use translation::{TranslatedDocument, TranslationData}; -pub(crate) use utils::{copy_dir_all, time, timestamp_nanosecond}; +pub(crate) use utils::{copy_dir_all, timestamp_nanosecond}; pub(crate) use version::Version; pub use {doc::resolve_foreign_variable2, doc::resolve_import};