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
use ;
/// Reads the entire contents of a file into a `String`.
///
/// # Arguments
/// * `path` - A string slice representing the path to the file.
///
/// # Returns
/// * `Ok(String)` containing the file contents if successful.
/// * `Err(String)` with an error message if the file could not be opened or read.
/// Extracts the file extension from a file path, if any.
///
/// # Arguments
/// * `path` - A string slice representing the path to the file.
///
/// # Returns
/// * `Some(String)` the file extension if present.
/// * `None` if the file has no extension.