Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changes/ctor-1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
tauri-utils: patch:deps
---

Updated `ctor` crate to `1`
37 changes: 3 additions & 34 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions crates/tauri-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ serde_with = "3"
aes-gcm = { version = "0.10", optional = true }
getrandom = { version = "0.3", optional = true, features = ["std"] }
serialize-to-javascript = { version = "0.1.2", optional = true }
ctor = { version = "0.8", default-features = false, features = [
"std",
"proc_macro",
] }
ctor = { version = "1.0", default-features = false, features = ["std"] }
json5 = { version = "0.4", optional = true }
# Part of public api in error type
toml = { version = ">=0.9, <=1", features = ["parse"] }
Expand Down
11 changes: 6 additions & 5 deletions crates/tauri-utils/src/platform/starting_binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT

use ctor::ctor;
use ctor::declarative::ctor;
use std::{
io::{Error, ErrorKind, Result},
path::{Path, PathBuf},
};

/// A cached version of the current binary using [`ctor`] to cache it before even `main` runs.
#[ctor]
#[used]
pub(super) static STARTING_BINARY: StartingBinary = unsafe { StartingBinary::new() };
ctor! {
/// A cached version of the current binary using [`ctor`] to cache it before even `main` runs.
#[ctor(unsafe)]
pub(super) static STARTING_BINARY: StartingBinary = unsafe { StartingBinary::new() };
}

/// Represents a binary path that was cached when the program was loaded.
pub(super) struct StartingBinary(std::io::Result<PathBuf>);
Expand Down
Loading