| 1784 | } |
| 1785 | |
| 1786 | fn substitute_ch(yaml: &Yaml, ch: &str) -> Yaml { |
| 1787 | return match yaml { |
| 1788 | Yaml::Array(ref v) => { |
| 1789 | Yaml::Array( |
| 1790 | v.iter() |
| 1791 | .map(|e| substitute_ch(e, ch)) |
| 1792 | .collect::<Vec<Yaml>>() |
| 1793 | ) |
| 1794 | }, |
| 1795 | Yaml::Hash(ref h) => { |
| 1796 | Yaml::Hash( |
| 1797 | h.iter() |
| 1798 | .map(|(key,val)| (key.clone(), substitute_ch(val, ch)) ) |
| 1799 | .collect::<Hash>() |
| 1800 | ) |
| 1801 | }, |
| 1802 | Yaml::String(s) => Yaml::String( s.replace('.', ch) ), |
| 1803 | _ => yaml.clone(), |
| 1804 | } |
| 1805 | } |
| 1806 | } |
| 1807 | |
| 1808 | fn get_unicode_char(ch: &Yaml) -> Result<u32> { |