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
53
54
55
56
//! This build script checks if the current Rustc version is at least the
//! minimum required version.
//! If the current Rustc version is less than the minimum required version,
//! the build script will exit the build process with a non-zero exit code.
//!
//! The minimum required version is specified in the `min_version` variable.
use process;
/// Checks if the current Rustc version is at least the minimum required version
///
/// # Arguments
///
/// * `min_version` - The minimum required Rustc version as a string.
///
/// # Returns
///
/// * `Some(true)` - If the current Rustc version is at least the minimum
/// required version.
/// * `Some(false)` - If the current Rustc version is less than the minimum
/// required version.
/// * `None` - If the current Rustc version cannot be determined.
///
/// # Errors
///
/// This function will exit the build process with a non-zero exit code if the
/// current Rustc version is less than the minimum required version.
///
/// # Examples
///
/// ```rust
/// let min_version = "1.56";
///
/// match version_check::is_min_version(min_version) {
/// Some(true) => println!("Rustc version is at least {}", min_version),
/// Some(false) => {
/// eprintln!("Rustc version is less than {}", min_version);
/// process::exit(1);
/// }
/// None => {
/// eprintln!("Unable to determine Rustc version");
/// process::exit(1);
/// }
/// }
/// ```