From beac08b2f629f7aa0bd3dfa4cd7ba5dbb506c873 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Wed, 18 Mar 2026 12:17:54 -0400 Subject: [PATCH] deprecate old code --- .../helpers/handle_successful_generations.rs | 2 +- .../worldlabs/threads/worldlabs_marble_task_polling.rs | 2 +- .../download_extension.rs | 1 + .../extract_download_extension_from_url.rs | 8 +++++--- crates/lib/url_utils/src/download_extension/mod.rs | 4 ++++ crates/lib/url_utils/src/extension/mod.rs | 2 -- crates/lib/url_utils/src/lib.rs | 3 ++- 7 files changed, 14 insertions(+), 8 deletions(-) rename crates/lib/url_utils/src/{extension => download_extension}/download_extension.rs (94%) rename crates/lib/url_utils/src/{extension => download_extension}/extract_download_extension_from_url.rs (75%) create mode 100644 crates/lib/url_utils/src/download_extension/mod.rs diff --git a/crates/desktop/artcraft/src/services/sora/threads/sora_task_polling/helpers/handle_successful_generations.rs b/crates/desktop/artcraft/src/services/sora/threads/sora_task_polling/helpers/handle_successful_generations.rs index 51d0c395f1..ab9af46b95 100644 --- a/crates/desktop/artcraft/src/services/sora/threads/sora_task_polling/helpers/handle_successful_generations.rs +++ b/crates/desktop/artcraft/src/services/sora/threads/sora_task_polling/helpers/handle_successful_generations.rs @@ -43,7 +43,7 @@ use artcraft_client::endpoints::media_files::upload_video_media_file_from_file:: use artcraft_client::endpoints::prompts::create_prompt::create_prompt; use tauri::AppHandle; use tempdir::TempDir; -use url_utils::extension::extract_download_extension_from_url::{extract_download_extension_from_url, extract_download_extension_from_url_str}; +use url_utils::download_extension::extract_download_extension_from_url::{extract_download_extension_from_url, extract_download_extension_from_url_str}; pub struct SuccessfulGeneration { pub prompt: Option, diff --git a/crates/desktop/artcraft/src/services/worldlabs/threads/worldlabs_marble_task_polling.rs b/crates/desktop/artcraft/src/services/worldlabs/threads/worldlabs_marble_task_polling.rs index 738fedda91..a47b895ae7 100644 --- a/crates/desktop/artcraft/src/services/worldlabs/threads/worldlabs_marble_task_polling.rs +++ b/crates/desktop/artcraft/src/services/worldlabs/threads/worldlabs_marble_task_polling.rs @@ -57,7 +57,7 @@ use artcraft_client::recipes::upload_media_file_from_file::upload_media_file_fro use tauri::AppHandle; use tokens::tokens::batch_generations::BatchGenerationToken; use url::Url; -use url_utils::extension::extract_download_extension_from_url::extract_download_extension_from_url_str; +use url_utils::download_extension::extract_download_extension_from_url::extract_download_extension_from_url_str; use world_labs_client::api::api_types::world_id::WorldObjectId; use world_labs_client::api::requests::worlds::poll_world_status::{poll_world_status, PollWorldStatusArgs}; use world_labs_client::credentials::world_labs_bearer_token::WorldLabsBearerToken; diff --git a/crates/lib/url_utils/src/extension/download_extension.rs b/crates/lib/url_utils/src/download_extension/download_extension.rs similarity index 94% rename from crates/lib/url_utils/src/extension/download_extension.rs rename to crates/lib/url_utils/src/download_extension/download_extension.rs index c24057b04b..4193b07467 100644 --- a/crates/lib/url_utils/src/extension/download_extension.rs +++ b/crates/lib/url_utils/src/download_extension/download_extension.rs @@ -1,5 +1,6 @@ /// When downloading a remote file, it makes sense to try to match the same file extension (with reasonable safeguards). +#[deprecated(note = "Use `Extension` in `url_utils::extension::extension` instead")] #[derive(Debug, Copy, Clone, Eq, PartialEq)] pub enum DownloadExtension { // Image diff --git a/crates/lib/url_utils/src/extension/extract_download_extension_from_url.rs b/crates/lib/url_utils/src/download_extension/extract_download_extension_from_url.rs similarity index 75% rename from crates/lib/url_utils/src/extension/extract_download_extension_from_url.rs rename to crates/lib/url_utils/src/download_extension/extract_download_extension_from_url.rs index a78cdba2cd..1d0c1b6465 100644 --- a/crates/lib/url_utils/src/extension/extract_download_extension_from_url.rs +++ b/crates/lib/url_utils/src/download_extension/extract_download_extension_from_url.rs @@ -1,13 +1,15 @@ -use crate::extension::download_extension::DownloadExtension; +use crate::download_extension::DownloadExtension; use url::Url; /// This should be used for naming files on the local file system based on their URL. +#[deprecated(note = "Use `extract_extension_from_url_str` in `url_utils::extension::extract_extension_from_url` instead")] pub fn extract_download_extension_from_url_str(url: &str) -> Option { let parsed_url = Url::parse(url).ok()?; extract_download_extension_from_url(&parsed_url) } /// This should be used for naming files on the local file system based on their URL. +#[deprecated(note = "Use `extract_extension_from_url` in `url_utils::extension::extract_extension_from_url` instead")] pub fn extract_download_extension_from_url(url: &Url) -> Option { let path = url.path(); let extension = std::path::Path::new(path) @@ -18,8 +20,8 @@ pub fn extract_download_extension_from_url(url: &Url) -> Option