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
//! Functions used to load and write JSON to a file.
use ;
/// Loads JSON from a file to a string.
///
/// # Arguments
///
/// * `path` - The file path.
///
/// # Examples
///
/// ```rust,ignore
/// use std::path::Path;
/// use json_keyquotes_convert::{load_write_utils};
///
/// let path = Path::new("./test_resources/Test_with_keyquotes.json");
/// let json: String = load_write_utils::load_json(&path).expect("Couldn't load from file!");
/// ```
/// Writes JSON from a string to a file.
///
/// # Arguments
///
/// * `path` - The file path.
/// * `json` - The JSON string to write.
///
/// # Examples
///
/// ```rust,ignore
/// use std::path::Path;
/// use json_keyquotes_convert::{load_write_utils};
///
/// let path = Path::new("./test_resources/Test_with_keyquotes.json");
/// load_write_utils::write_json(&path, &json).expect("Couldn't write to file!");
/// ```