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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
//! Dictionary merging operations for ODict.
//!
//! This module provides functionality to combine multiple dictionaries into a single
//! dictionary, preserving unique entries and avoiding duplicates.
//!
//! # Overview
//!
//! The merge operations allow you to:
//! - Merge a single dictionary into another
//! - Merge multiple dictionaries at once
//! - Preserve unique entries (no duplicates)
//!
//! # Examples
//!
//! ## Merging Two Dictionaries
//!
//! ```rust
//! use odict::Dictionary;
//!
//! let mut dict1 = Dictionary::from_path("dict1.xml")?;
//! let dict2 = Dictionary::from_path("dict2.xml")?;
//!
//! // Merge dict2 into dict1
//! dict1.merge(&dict2);
//! # Ok::<(), Box<dyn std::error::Error>>(())
//! ```
//!
//! ## Merging Multiple Dictionaries
//!
//! ```rust
//! use odict::Dictionary;
//!
//! let mut main_dict = Dictionary::from_path("main.xml")?;
//! let dict2 = Dictionary::from_path("dict2.xml")?;
//! let dict3 = Dictionary::from_path("dict3.xml")?;
//!
//! // Merge multiple dictionaries at once
//! main_dict.merge_multi(vec![&dict2, &dict3]);
//! # Ok::<(), Box<dyn std::error::Error>>(())
//! ```
use crateDictionary;