(pattern: &str)
| 36 | pub type ConfigPermission = HashMap<String, ConfigValue>; |
| 37 | |
| 38 | fn expand(pattern: &str) -> String { |
| 39 | if let Some(home) = dirs::home_dir() { |
| 40 | if pattern.starts_with("~/") { |
| 41 | return format!("{}{}", home.display(), &pattern[1..]); |
| 42 | } |
| 43 | if pattern == "~" { |
| 44 | return home.display().to_string(); |
| 45 | } |
| 46 | if pattern.starts_with("$HOME/") { |
| 47 | return format!("{}{}", home.display(), &pattern[5..]); |
| 48 | } |
| 49 | } |
| 50 | pattern.to_string() |
| 51 | } |
| 52 | |
| 53 | pub fn from_config(permission: &ConfigPermission) -> PermissionRuleset { |
| 54 | let mut ruleset: PermissionRuleset = Vec::new(); |
no test coverage detected