mirror of
https://github.com/EthanShoeDev/fressh.git
synced 2026-01-12 23:02:49 +00:00
lint passing
This commit is contained in:
@@ -4,6 +4,9 @@ default:
|
||||
@just --list
|
||||
|
||||
lint:
|
||||
cargo clippy --all-targets --all-features --fix --allow-dirty -- -D warnings
|
||||
|
||||
lint-check:
|
||||
cargo clippy --all-targets --all-features -- -D warnings
|
||||
|
||||
# Update all Cargo dependencies to the latest allowed by Cargo.toml
|
||||
@@ -16,4 +19,7 @@ test:
|
||||
|
||||
|
||||
fmt:
|
||||
cargo fmt
|
||||
cargo fmt
|
||||
|
||||
fmt-check:
|
||||
cargo fmt -- --check
|
||||
@@ -70,7 +70,6 @@ pub trait ConnectionDisconnectedCallback: Send + Sync {
|
||||
fn on_change(&self, connection_id: String);
|
||||
}
|
||||
|
||||
/// Snapshot of current connection info for property-like access in TS.
|
||||
#[derive(Debug, Clone, PartialEq, uniffi::Record)]
|
||||
pub struct SshConnectionInfo {
|
||||
pub connection_id: String,
|
||||
@@ -82,8 +81,9 @@ pub struct SshConnectionInfo {
|
||||
|
||||
#[derive(uniffi::Object)]
|
||||
pub struct SshConnection {
|
||||
pub(crate) info: SshConnectionInfo,
|
||||
pub(crate) on_disconnected_callback: Option<Arc<dyn ConnectionDisconnectedCallback>>,
|
||||
pub info: SshConnectionInfo,
|
||||
pub on_disconnected_callback: Option<Arc<dyn ConnectionDisconnectedCallback>>,
|
||||
|
||||
pub(crate) client_handle: AsyncMutex<ClientHandle<NoopHandler>>,
|
||||
|
||||
pub(crate) shells: AsyncMutex<HashMap<u32, Arc<ShellSession>>>,
|
||||
@@ -265,7 +265,7 @@ impl SshConnection {
|
||||
sender: tx,
|
||||
listener_tasks: Arc::new(Mutex::new(HashMap::new())),
|
||||
next_listener_id: AtomicU64::new(1),
|
||||
default_coalesce_ms,
|
||||
coalesce_ms: default_coalesce_ms,
|
||||
rt_handle: tokio::runtime::Handle::current(),
|
||||
});
|
||||
|
||||
|
||||
@@ -116,8 +116,8 @@ pub struct ShellSessionInfo {
|
||||
|
||||
#[derive(uniffi::Object)]
|
||||
pub struct ShellSession {
|
||||
pub(crate) info: ShellSessionInfo,
|
||||
pub(crate) on_closed_callback: Option<Arc<dyn ShellClosedCallback>>,
|
||||
pub info: ShellSessionInfo,
|
||||
pub on_closed_callback: Option<Arc<dyn ShellClosedCallback>>,
|
||||
|
||||
// Weak backref; avoid retain cycle.
|
||||
pub(crate) parent: std::sync::Weak<SshConnection>,
|
||||
@@ -140,7 +140,7 @@ pub struct ShellSession {
|
||||
// Listener tasks management
|
||||
pub(crate) listener_tasks: Arc<Mutex<HashMap<u64, tokio::task::JoinHandle<()>>>>,
|
||||
pub(crate) next_listener_id: AtomicU64,
|
||||
pub(crate) default_coalesce_ms: AtomicU64,
|
||||
pub(crate) coalesce_ms: AtomicU64,
|
||||
pub(crate) rt_handle: tokio::runtime::Handle,
|
||||
}
|
||||
|
||||
@@ -383,7 +383,7 @@ impl ShellSession {
|
||||
let replay = self.read_buffer(opts.cursor.clone(), None);
|
||||
let mut rx = self.sender.subscribe();
|
||||
let id = self.next_listener_id.fetch_add(1, Ordering::Relaxed);
|
||||
let default_coalesce_ms = self.default_coalesce_ms.load(Ordering::Relaxed) as u32;
|
||||
let default_coalesce_ms = self.coalesce_ms.load(Ordering::Relaxed) as u32;
|
||||
let coalesce_ms = opts.coalesce_ms.unwrap_or(default_coalesce_ms);
|
||||
|
||||
let rt = self.rt_handle.clone();
|
||||
|
||||
Reference in New Issue
Block a user