Gate iOS only imports (#2175)

- Fix Windows build
 - Clippy auto
This commit is contained in:
Vítor Vasconcellos 2024-03-07 00:10:50 -03:00 committed by GitHub
parent 05782165e7
commit 54acb0dd86
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 13 additions and 18 deletions

View file

@ -5,7 +5,6 @@
use crate::{invalidate_query, library::Library, location::manager::LocationManagerError, Node};
use sd_prisma::prisma::location;
use sd_utils::error::FileIOError;
use std::{
collections::{BTreeMap, HashMap},
@ -14,15 +13,12 @@ use std::{
};
use async_trait::async_trait;
use notify::{
event::{CreateKind, DataChange, ModifyKind, RenameMode},
Event,
};
use tokio::{fs, time::Instant};
use notify::Event;
use tokio::time::Instant;
use tracing::{error, info, trace};
use super::{
utils::{create_dir, recalculate_directories_size, remove, rename, update_file},
utils::{recalculate_directories_size, remove, update_file},
EventHandler, HUNDRED_MILLIS, ONE_SECOND,
};

View file

@ -4,7 +4,7 @@ use std::str;
use serde::{Deserialize, Serialize};
use specta::Type;
use strum_macros::{Display, EnumIter};
use sysinfo::{System, SystemExt};
use sysinfo::SystemExt;
#[repr(i32)]
#[derive(Debug, Clone, Display, Copy, EnumIter, Type, Serialize, Deserialize, Eq, PartialEq)]

View file

@ -2,28 +2,19 @@
use sd_cache::Model;
use std::{
collections::HashMap,
fmt::Display,
hash::{Hash, Hasher},
os::unix::fs::MetadataExt,
path::PathBuf,
sync::OnceLock,
};
#[cfg(target_os = "ios")]
use icrate::{
objc2::runtime::{Class, Object},
objc2::{msg_send, sel},
Foundation::{self, ns_string, NSFileManager, NSFileSystemSize, NSNumber, NSString},
};
use serde::{Deserialize, Serialize};
use serde_with::{serde_as, DisplayFromStr};
use specta::Type;
use sysinfo::{DiskExt, System, SystemExt};
use thiserror::Error;
use tokio::sync::Mutex;
use tracing::{error, info};
use tracing::error;
pub mod watcher;
@ -234,6 +225,14 @@ pub async fn get_volumes() -> Vec<Volume> {
#[cfg(target_os = "ios")]
pub async fn get_volumes() -> Vec<Volume> {
use std::os::unix::fs::MetadataExt;
use icrate::{
objc2::runtime::{Class, Object},
objc2::{msg_send, sel},
Foundation::{self, ns_string, NSFileManager, NSFileSystemSize, NSNumber, NSString},
};
let mut volumes: Vec<Volume> = Vec::new();
unsafe {