Remove dependency on once_cell and use std types (#2746)

* Remove dependency on once_cell and use std types

* Bump MSRV across the project to 1.81

* Cargo fmt

* Update rust-toolchain to 1.81
This commit is contained in:
Consoli 2024-09-30 18:19:59 -03:00 committed by GitHub
parent 1e2fe41d75
commit 8ce9f30121
30 changed files with 132 additions and 130 deletions

6
Cargo.lock generated
View File

@ -8036,7 +8036,6 @@ dependencies = [
"half",
"image",
"ndarray",
"once_cell",
"ort",
"prisma-client-rust",
"reqwest 0.11.27",
@ -8103,7 +8102,6 @@ dependencies = [
"mini-moka",
"normpath",
"notify",
"once_cell",
"openssl",
"openssl-sys",
"pin-project-lite",
@ -8192,7 +8190,6 @@ dependencies = [
"image",
"itertools 0.13.0",
"lending-stream",
"once_cell",
"prisma-client-rust",
"rmp-serde",
"rmpv",
@ -8232,7 +8229,6 @@ dependencies = [
"futures-concurrency",
"gix-ignore",
"globset",
"once_cell",
"prisma-client-rust",
"rmp-serde",
"rspc",
@ -8417,7 +8413,6 @@ dependencies = [
"image",
"libheif-rs",
"libheif-sys",
"once_cell",
"pdfium-render",
"resvg",
"rspc",
@ -8459,7 +8454,6 @@ dependencies = [
"futures",
"futures-channel",
"futures-locks",
"once_cell",
"rspc",
"sd-core",
"serde_json",

View File

@ -16,7 +16,7 @@ resolver = "2"
edition = "2021"
license = "AGPL-3.0-only"
repository = "https://github.com/spacedriveapp/spacedrive"
rust-version = "1.80"
rust-version = "1.81"
[workspace.dependencies]
# Third party dependencies used by one or more of our crates
@ -39,7 +39,6 @@ lending-stream = "1.0"
libc = "0.2"
mimalloc = "0.1.43"
normpath = "1.2"
once_cell = "1.19"
pin-project-lite = "0.2.14"
rand = "0.9.0-alpha.2"
regex = "1.10"

View File

@ -2,10 +2,10 @@
name = "sd-mobile-android"
version = "0.1.0"
edition.workspace = true
license.workspace = true
repository.workspace = true
rust-version = "1.64"
edition.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
[lib]
# Android can use dynamic linking since all FFI is done via JNI

View File

@ -2,10 +2,10 @@
name = "sd-mobile-core"
version = "0.1.0"
edition.workspace = true
license.workspace = true
repository.workspace = true
rust-version = "1.64"
edition.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
[target.'cfg(target_os = "android")'.dependencies]
sd-core = { default-features = false, features = ["mobile"], path = "../../../../../core" }
@ -19,7 +19,6 @@ sd-core = { default-features = false, features = [
# Workspace dependencies
futures = { workspace = true }
once_cell = { workspace = true }
rspc = { workspace = true }
serde_json = { workspace = true }
tokio = { workspace = true }

View File

@ -2,7 +2,6 @@
use futures::{future::join_all, StreamExt};
use futures_channel::mpsc;
use once_cell::sync::{Lazy, OnceCell};
use rspc::internal::jsonrpc::{
self, handle_json_rpc, OwnedMpscSender, Request, RequestId, Response, Sender,
SubscriptionUpgrade,
@ -14,7 +13,7 @@ use std::{
collections::HashMap,
future::{ready, Ready},
marker::Send,
sync::Arc,
sync::{Arc, LazyLock, OnceLock},
};
use tokio::{
runtime::Runtime,
@ -22,17 +21,18 @@ use tokio::{
};
use tracing::error;
pub static RUNTIME: Lazy<Runtime> = Lazy::new(|| Runtime::new().unwrap());
pub static RUNTIME: LazyLock<Runtime> = LazyLock::new(|| Runtime::new().unwrap());
pub type NodeType = Lazy<Mutex<Option<(Arc<Node>, Arc<Router>)>>>;
pub type NodeType = LazyLock<Mutex<Option<(Arc<Node>, Arc<Router>)>>>;
pub static NODE: NodeType = Lazy::new(|| Mutex::new(None));
pub static NODE: NodeType = LazyLock::new(|| Mutex::new(None));
#[allow(clippy::type_complexity)]
pub static SUBSCRIPTIONS: Lazy<Arc<futures_locks::Mutex<HashMap<RequestId, oneshot::Sender<()>>>>> =
Lazy::new(Default::default);
pub static SUBSCRIPTIONS: LazyLock<
Arc<futures_locks::Mutex<HashMap<RequestId, oneshot::Sender<()>>>>,
> = LazyLock::new(Default::default);
pub static EVENT_SENDER: OnceCell<mpsc::Sender<Response>> = OnceCell::new();
pub static EVENT_SENDER: OnceLock<mpsc::Sender<Response>> = OnceLock::new();
pub const CLIENT_ID: &str = "d068776a-05b6-4aaa-9001-4d01734e1944";

View File

@ -2,10 +2,10 @@
name = "sd-mobile-ios"
version = "0.1.0"
edition.workspace = true
license.workspace = true
repository.workspace = true
rust-version = "1.64"
edition.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
[lib]
# iOS requires static linking

View File

@ -2,12 +2,12 @@
name = "sd-core"
version = "0.4.2"
authors = ["Spacedrive Technology Inc <support@spacedrive.com>"]
description = "Virtual distributed filesystem engine that powers Spacedrive."
edition.workspace = true
license.workspace = true
repository.workspace = true
rust-version = "1.78"
authors = ["Spacedrive Technology Inc <support@spacedrive.com>"]
description = "Virtual distributed filesystem engine that powers Spacedrive."
edition.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
[features]
default = []
@ -57,7 +57,6 @@ image = { workspace = true }
itertools = { workspace = true }
libc = { workspace = true }
normpath = { workspace = true, features = ["localization"] }
once_cell = { workspace = true }
pin-project-lite = { workspace = true }
prisma-client-rust = { workspace = true, features = ["rspc"] }
regex = { workspace = true }

View File

@ -2,12 +2,12 @@
name = "sd-core-file-path-helper"
version = "0.1.0"
authors = ["Ericson Soares <ericson@spacedrive.com>"]
edition.workspace = true
license.workspace = true
readme = "README.md"
repository.workspace = true
rust-version = "1.75"
authors = ["Ericson Soares <ericson@spacedrive.com>"]
edition.workspace = true
license.workspace = true
readme = "README.md"
repository.workspace = true
rust-version.workspace = true
[dependencies]
# Inner Core Sub-crates

View File

@ -40,7 +40,6 @@ globset = { workspace = true }
image = { workspace = true }
itertools = { workspace = true }
lending-stream = { workspace = true }
once_cell = { workspace = true }
prisma-client-rust = { workspace = true }
rmp-serde = { workspace = true }
rmpv = { workspace = true }

View File

@ -1167,7 +1167,8 @@ impl JobTaskDispatcher {
matches!(
*state,
JobRunningState::Running
| JobRunningState::Canceled | JobRunningState::Shutdown
| JobRunningState::Canceled
| JobRunningState::Shutdown
)
})
.await

View File

@ -344,8 +344,10 @@ impl Status {
matches!(
self,
Self::Completed
| Self::Canceled | Self::Paused
| Self::Failed | Self::CompletedWithErrors
| Self::Canceled
| Self::Paused
| Self::Failed
| Self::CompletedWithErrors
)
}
}

View File

@ -83,7 +83,9 @@ pub async fn load_jobs<OuterCtx: OuterContext, JobCtx: JobContext<OuterCtx>>(
root_job: StoredJob { id, .. },
next_jobs,
..
}| { iter::once(*id).chain(next_jobs.iter().map(|StoredJob { id, .. }| *id)) },
}| {
iter::once(*id).chain(next_jobs.iter().map(|StoredJob { id, .. }| *id))
},
)
.map(|job_id| uuid_to_bytes(&job_id))
.collect::<Vec<_>>(),

View File

@ -12,14 +12,13 @@ use sd_prisma::{
use sd_sync::{option_sync_db_entry, OperationFactory};
use sd_utils::chain_optional_iter;
use std::path::Path;
use std::{path::Path, sync::LazyLock};
use futures_concurrency::future::TryJoin;
use once_cell::sync::Lazy;
use super::from_slice_option_to_option;
pub static AVAILABLE_EXTENSIONS: Lazy<Vec<Extension>> = Lazy::new(|| {
pub static AVAILABLE_EXTENSIONS: LazyLock<Vec<Extension>> = LazyLock::new(|| {
ALL_IMAGE_EXTENSIONS
.iter()
.copied()

View File

@ -26,16 +26,15 @@ use sd_utils::{
i64_to_frontend,
};
use std::{collections::HashMap, path::Path};
use std::{collections::HashMap, path::Path, sync::LazyLock};
use futures_concurrency::future::TryJoin;
use once_cell::sync::Lazy;
use prisma_client_rust::QueryError;
use tracing::error;
use super::from_slice_option_to_option;
pub static AVAILABLE_EXTENSIONS: Lazy<Vec<Extension>> = Lazy::new(|| {
pub static AVAILABLE_EXTENSIONS: LazyLock<Vec<Extension>> = LazyLock::new(|| {
ALL_AUDIO_EXTENSIONS
.iter()
.copied()
@ -61,12 +60,15 @@ pub const fn can_extract_for_audio(audio_extension: AudioExtension) -> bool {
matches!(
audio_extension,
Mp3 | Mp2
| M4a | Wav | Aiff
| Aif | Flac | Ogg
| Oga | Opus | Wma
| Amr | Aac | Wv
| Voc | Tta | Loas
| Caf | Aptx | Adts
| M4a | Wav
| Aiff | Aif
| Flac | Ogg
| Oga | Opus
| Wma | Amr
| Aac | Wv
| Voc | Tta
| Loas | Caf
| Aptx | Adts
| Ast | Mid
)
}
@ -81,15 +83,18 @@ pub const fn can_extract_for_video(video_extension: VideoExtension) -> bool {
matches!(
video_extension,
Avi | Avifs
| Qt | Mov | Swf
| Mjpeg | Mpeg
| Mxf | M2v | Mpg
| Mpe | M2ts | Flv
| Wm | _3gp | M4v
| Wmv | Asf | Mp4
| Webm | Mkv | Vob
| Ogv | Wtv | Hevc
| F4v // | Ts | Mts TODO: Uncomment when we start using magic instead of extension
| Qt | Mov
| Swf | Mjpeg
| Mpeg | Mxf
| M2v | Mpg
| Mpe | M2ts
| Flv | Wm
| _3gp | M4v
| Wmv | Asf
| Mp4 | Webm
| Mkv | Vob
| Ogv | Wtv
| Hevc | F4v // | Ts | Mts TODO: Uncomment when we start using magic instead of extension
)
}

View File

@ -17,11 +17,11 @@ use std::{
panic,
path::{Path, PathBuf},
str::FromStr,
sync::LazyLock,
time::Duration,
};
use image::{imageops, DynamicImage, GenericImageView};
use once_cell::sync::Lazy;
use serde::{Deserialize, Serialize};
use specta::Type;
use tokio::{
@ -55,7 +55,7 @@ pub fn get_thumbnails_directory(data_directory: impl AsRef<Path>) -> PathBuf {
}
#[cfg(feature = "ffmpeg")]
pub static THUMBNAILABLE_VIDEO_EXTENSIONS: Lazy<Vec<Extension>> = Lazy::new(|| {
pub static THUMBNAILABLE_VIDEO_EXTENSIONS: LazyLock<Vec<Extension>> = LazyLock::new(|| {
ALL_VIDEO_EXTENSIONS
.iter()
.copied()
@ -64,7 +64,7 @@ pub static THUMBNAILABLE_VIDEO_EXTENSIONS: Lazy<Vec<Extension>> = Lazy::new(|| {
.collect()
});
pub static THUMBNAILABLE_EXTENSIONS: Lazy<Vec<Extension>> = Lazy::new(|| {
pub static THUMBNAILABLE_EXTENSIONS: LazyLock<Vec<Extension>> = LazyLock::new(|| {
ALL_IMAGE_EXTENSIONS
.iter()
.copied()
@ -80,7 +80,7 @@ pub static THUMBNAILABLE_EXTENSIONS: Lazy<Vec<Extension>> = Lazy::new(|| {
.collect()
});
pub static ALL_THUMBNAILABLE_EXTENSIONS: Lazy<Vec<Extension>> = Lazy::new(|| {
pub static ALL_THUMBNAILABLE_EXTENSIONS: LazyLock<Vec<Extension>> = LazyLock::new(|| {
#[cfg(feature = "ffmpeg")]
return THUMBNAILABLE_EXTENSIONS
.iter()
@ -101,6 +101,11 @@ static WEBP_CONFIG: std::sync::LazyLock<WebPConfig> = std::sync::LazyLock::new(|
config
});
const HALF_SEC: Duration = Duration::from_millis(500);
static LAST_SINGLE_THUMB_GENERATED_LOCK: LazyLock<Mutex<Instant>> =
LazyLock::new(|| Mutex::new(Instant::now()));
/// This type is used to pass the relevant data to the frontend so it can request the thumbnail.
/// Tt supports extending the shard hex to support deeper directory structures in the future
#[derive(Debug, Serialize, Deserialize, Type, Clone)]
@ -487,10 +492,6 @@ async fn generate_video_thumbnail(
})
}
const HALF_SEC: Duration = Duration::from_millis(500);
static LAST_SINGLE_THUMB_GENERATED_LOCK: Lazy<Mutex<Instant>> =
Lazy::new(|| Mutex::new(Instant::now()));
/// WARNING!!!! DON'T USE THIS FUNCTION IN A LOOP!!!!!!!!!!!!! It will be pretty slow on purpose!
pub async fn generate_single_thumbnail(
thumbnails_directory: impl AsRef<Path> + Send,

View File

@ -16,7 +16,6 @@ sd-utils = { path = "../../../crates/utils" }
chrono = { workspace = true }
futures-concurrency = { workspace = true }
globset = { workspace = true, features = ["serde1"] }
once_cell = { workspace = true }
prisma-client-rust = { workspace = true }
rmp-serde = { workspace = true }
rspc = { workspace = true }

View File

@ -1,11 +1,13 @@
use sd_prisma::prisma::{indexer_rule, PrismaClient};
use std::path::{Path, PathBuf};
use std::{
path::{Path, PathBuf},
sync::LazyLock,
};
use chrono::Utc;
use futures_concurrency::future::Join;
use gix_ignore::{glob::search::pattern::List, search::Ignore, Search};
use once_cell::sync::Lazy;
use tokio::fs;
use uuid::Uuid;
@ -205,7 +207,7 @@ pub async fn new_or_existing_library(db: &PrismaClient) -> Result<(), SeederErro
Ok(())
}
pub static NO_SYSTEM_FILES: Lazy<SystemIndexerRule> = Lazy::new(|| {
pub static NO_SYSTEM_FILES: LazyLock<SystemIndexerRule> = LazyLock::new(|| {
SystemIndexerRule {
// TODO: On windows, beside the listed files, any file with the FILE_ATTRIBUTE_SYSTEM should be considered a system file
// https://learn.microsoft.com/en-us/windows/win32/fileio/file-attribute-constants#FILE_ATTRIBUTE_SYSTEM
@ -311,14 +313,14 @@ pub static NO_SYSTEM_FILES: Lazy<SystemIndexerRule> = Lazy::new(|| {
}
});
pub static NO_HIDDEN: Lazy<SystemIndexerRule> = Lazy::new(|| SystemIndexerRule {
pub static NO_HIDDEN: LazyLock<SystemIndexerRule> = LazyLock::new(|| SystemIndexerRule {
name: "No Hidden files",
default: false,
rules: vec![RulePerKind::new_reject_files_by_globs_str(["**/.*"])
.expect("this is hardcoded and should always work")],
});
pub static NO_GIT: Lazy<SystemIndexerRule> = Lazy::new(|| SystemIndexerRule {
pub static NO_GIT: LazyLock<SystemIndexerRule> = LazyLock::new(|| SystemIndexerRule {
name: "No Git files",
default: true,
rules: vec![RulePerKind::new_reject_files_by_globs_str([
@ -327,14 +329,14 @@ pub static NO_GIT: Lazy<SystemIndexerRule> = Lazy::new(|| SystemIndexerRule {
.expect("this is hardcoded and should always work")],
});
pub static GITIGNORE: Lazy<SystemIndexerRule> = Lazy::new(|| SystemIndexerRule {
pub static GITIGNORE: LazyLock<SystemIndexerRule> = LazyLock::new(|| SystemIndexerRule {
name: "Gitignore",
default: true,
// Empty rules because this rule is only used to allow frontend to toggle GitIgnoreRules
rules: vec![],
});
pub static ONLY_IMAGES: Lazy<SystemIndexerRule> = Lazy::new(|| SystemIndexerRule {
pub static ONLY_IMAGES: LazyLock<SystemIndexerRule> = LazyLock::new(|| SystemIndexerRule {
name: "Only Images",
default: false,
rules: vec![RulePerKind::new_accept_files_by_globs_str([

View File

@ -20,7 +20,7 @@ use std::{
pin::pin,
sync::{
atomic::{AtomicBool, Ordering},
Arc,
Arc, LazyLock,
},
time::Duration,
};
@ -32,7 +32,6 @@ use futures_concurrency::{
future::{Join, TryJoin},
stream::Merge,
};
use once_cell::sync::Lazy;
use prisma_client_rust::{raw, QueryError};
use rspc::{alpha::AlphaRouter, ErrorCode};
use serde::{Deserialize, Serialize};
@ -54,10 +53,11 @@ const TWO_MINUTES: Duration = Duration::from_secs(60 * 2);
const FIVE_MINUTES: Duration = Duration::from_secs(60 * 5);
static IS_COMPUTING_KIND_STATISTICS: AtomicBool = AtomicBool::new(false);
static LAST_KIND_STATISTICS_UPDATE: Lazy<RwLock<TotalFilesStatistics>> = Lazy::new(RwLock::default);
static LAST_KIND_STATISTICS_UPDATE: LazyLock<RwLock<TotalFilesStatistics>> =
LazyLock::new(RwLock::default);
static STATISTICS_UPDATERS: Lazy<Mutex<HashMap<Uuid, chan::Sender<Instant>>>> =
Lazy::new(|| Mutex::new(HashMap::new()));
static STATISTICS_UPDATERS: LazyLock<Mutex<HashMap<Uuid, chan::Sender<Instant>>>> =
LazyLock::new(|| Mutex::new(HashMap::new()));
struct TotalFilesStatistics {
updated_at: Instant,

View File

@ -752,7 +752,8 @@ async fn create_location(
.location()
.count(vec![location::path::equals(Some(path.clone()))])
.exec()
.await? > 0
.await?
> 0
{
return Err(LocationError::LocationAlreadyExists(location_path.into()));
}

View File

@ -13,9 +13,9 @@ use tracing::trace;
use std::{
ffi::OsStr,
path::{Path, PathBuf},
sync::LazyLock,
};
use once_cell::sync::Lazy;
use regex::Regex;
use serde::{Deserialize, Serialize};
@ -33,8 +33,8 @@ pub mod error;
use error::FileSystemJobsError;
use tokio::{fs, io};
static DUPLICATE_PATTERN: Lazy<Regex> =
Lazy::new(|| Regex::new(r" \(\d+\)").expect("Failed to compile hardcoded regex"));
static DUPLICATE_PATTERN: LazyLock<Regex> =
LazyLock::new(|| Regex::new(r" \(\d+\)").expect("Failed to compile hardcoded regex"));
// pub const BYTES_EXT: &str = ".bytes";

View File

@ -418,8 +418,10 @@ impl JobStatus {
matches!(
self,
Self::Completed
| Self::Canceled | Self::Paused
| Self::Failed | Self::CompletedWithErrors
| Self::Canceled
| Self::Paused
| Self::Failed
| Self::CompletedWithErrors
)
}
}

View File

@ -2,13 +2,13 @@
name = "sd-ai"
version = "0.1.0"
authors = ["Ericson Soares <ericson@spacedrive.com>"]
description = "A simple library to generate video thumbnails using ffmpeg with the webp format"
edition.workspace = true
license.workspace = true
readme = "README.md"
repository.workspace = true
rust-version = "1.75"
authors = ["Ericson Soares <ericson@spacedrive.com>"]
description = "A simple library to generate video thumbnails using ffmpeg with the webp format"
edition.workspace = true
license.workspace = true
readme = "README.md"
repository.workspace = true
rust-version.workspace = true
[dependencies]
# Inner Core Sub-crates
@ -26,7 +26,6 @@ chrono = { workspace = true, features = ["serde"] }
futures = { workspace = true }
futures-concurrency = { workspace = true }
image = { workspace = true }
once_cell = { workspace = true }
prisma-client-rust = { workspace = true }
reqwest = { workspace = true, features = ["native-tls-vendored", "stream"] }
rmp-serde = { workspace = true }

View File

@ -4,12 +4,12 @@ use std::{
collections::{HashMap, HashSet},
fmt::Display,
path::Path,
sync::LazyLock,
};
use half::f16;
use image::{imageops::FilterType, load_from_memory_with_format, GenericImageView, ImageFormat};
use ndarray::{s, Array, Axis};
use once_cell::sync::Lazy;
use ort::{inputs, SessionInputs, SessionOutputs};
use url::Url;
@ -32,7 +32,7 @@ const MODEL_LOCATION: &str = if cfg!(target_os = "macos") {
pub static DEFAULT_MODEL_VERSION: &str = "Yolo Small";
static MODEL_VERSIONS: Lazy<HashMap<&'static str, ModelSource>> = Lazy::new(|| {
static MODEL_VERSIONS: LazyLock<HashMap<&'static str, ModelSource>> = LazyLock::new(|| {
HashMap::from([
("Yolo Nano", ModelSource::Url(Url::parse("https://github.com/spacedriveapp/native-deps/releases/download/yolo-2023-12-05/yolov8n.onnx").expect("Must be a valid URL"))),
(DEFAULT_MODEL_VERSION, ModelSource::Path(get_path_relative_to_exe(Path::new(MODEL_LOCATION).join("yolov8s.onnx")))),

View File

@ -2,13 +2,13 @@
name = "sd-ffmpeg"
version = "0.1.0"
authors = ["Ericson Soares <ericson@spacedrive.com>", "Vítor Vasconcellos <vitor@spacedrive.com>"]
description = "A simple library to generate video thumbnails using ffmpeg with the webp format"
edition.workspace = true
license.workspace = true
readme = "README.md"
repository.workspace = true
rust-version = "1.78"
authors = ["Ericson Soares <ericson@spacedrive.com>", "Vítor Vasconcellos <vitor@spacedrive.com>"]
description = "A simple library to generate video thumbnails using ffmpeg with the webp format"
edition.workspace = true
license.workspace = true
readme = "README.md"
repository.workspace = true
rust-version.workspace = true
[dependencies]
# Spacedrive Sub-crates

View File

@ -13,7 +13,6 @@ heif = ["dep:libheif-rs", "dep:libheif-sys"]
[dependencies]
# Workspace dependencies
image = { workspace = true }
once_cell = { workspace = true }
rspc = { workspace = true, optional = true } # error conversion
serde = { workspace = true, optional = true, features = ["derive"] }
specta = { workspace = true, optional = true }

View File

@ -2,12 +2,12 @@ pub use crate::error::{Error, Result};
use crate::ImageHandler;
use image::DynamicImage;
use libheif_rs::{ColorSpace, HeifContext, LibHeif, RgbChroma};
use once_cell::sync::Lazy;
use std::io::{Cursor, SeekFrom};
use std::io::{Read, Seek};
use std::path::Path;
use std::sync::LazyLock;
static HEIF: Lazy<LibHeif> = Lazy::new(LibHeif::new);
static HEIF: LazyLock<LibHeif> = LazyLock::new(LibHeif::new);
pub struct HeifHandler {}

View File

@ -1,6 +1,7 @@
use std::{
env::current_exe,
path::{Path, PathBuf},
sync::LazyLock,
};
use crate::{
@ -8,7 +9,6 @@ use crate::{
ImageHandler, Result,
};
use image::DynamicImage;
use once_cell::sync::Lazy;
use pdfium_render::prelude::{PdfColor, PdfPageRenderRotation, PdfRenderConfig, Pdfium};
use tracing::error;
@ -22,7 +22,7 @@ const BINDING_LOCATION: &str = if cfg!(target_os = "macos") {
"../lib/spacedrive"
};
static PDFIUM_LIB: Lazy<String> = Lazy::new(|| {
static PDFIUM_LIB: LazyLock<String> = LazyLock::new(|| {
let lib_name = Pdfium::pdfium_platform_library_name();
current_exe()
.ok()
@ -65,11 +65,11 @@ fn thumbnail_config(config: PdfRenderConfig) -> PdfRenderConfig {
.clear_before_rendering(true)
}
static PORTRAIT_CONFIG: Lazy<PdfRenderConfig> = Lazy::new(|| {
static PORTRAIT_CONFIG: LazyLock<PdfRenderConfig> = LazyLock::new(|| {
thumbnail_config(PdfRenderConfig::new().set_target_width(PDF_PORTRAIT_RENDER_WIDTH))
});
static LANDSCAPE_CONFIG: Lazy<PdfRenderConfig> = Lazy::new(|| {
static LANDSCAPE_CONFIG: LazyLock<PdfRenderConfig> = LazyLock::new(|| {
thumbnail_config(PdfRenderConfig::new().set_target_width(PDF_LANDSCAPE_RENDER_WIDTH))
});

View File

@ -2,11 +2,11 @@
name = "sd-sync-example"
version = "0.1.0"
edition.workspace = true
license.workspace = true
publish = false
repository.workspace = true
rust-version = "1.64"
edition.workspace = true
license.workspace = true
publish = false
repository.workspace = true
rust-version.workspace = true
[dependencies]
# Spacedrive Sub-crates

View File

@ -2,11 +2,11 @@
name = "sd-task-system"
version = "0.1.0"
authors = ["Ericson Soares <ericson@spacedrive.com>"]
edition.workspace = true
license.workspace = true
repository.workspace = true
rust-version = "1.75"
authors = ["Ericson Soares <ericson@spacedrive.com>"]
edition.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
[dependencies]
# Workspace deps

View File

@ -1,2 +1,2 @@
[toolchain]
channel = "1.80"
channel = "1.81"