1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
use Result;
/// Detects the current platform target for binary downloads.
///
/// This function determines the Rust target triple for the current platform,
/// which is used to identify the correct binary asset to download from GitHub releases.
/// The detection is based on the OS and architecture constants provided by Rust's
/// standard library.
///
/// # Returns
///
/// Returns the Rust target triple as a `String` for the current platform.
///
/// # Errors
///
/// Returns an error if the current platform combination is not supported
/// for automatic updates.
///
/// # Supported Platforms
///
/// - **Linux**: `x86_64`, aarch64
/// - **macOS**: `x86_64` (Intel), aarch64 (Apple Silicon)
/// - **Windows**: `x86_64`
///
/// # Examples
///
/// ```rust
/// use image_optimizer::updater::platform_detector::get_platform_target;
///
/// # fn example() -> anyhow::Result<()> {
/// let target = get_platform_target()?;
/// // On Apple Silicon Mac: "aarch64-apple-darwin"
/// // On Intel Mac: "x86_64-apple-darwin"
/// // On Linux x64: "x86_64-unknown-linux-gnu"
/// # Ok(())
/// # }
/// ```