{"record":{"id":"d981d4029cbbae4c","repo":"tonhowtf/omniget","slug":"regra-desconhecida","errorCode":null,"errorMessage":"regra desconhecida: {}","messagePattern":"regra desconhecida: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/win_tweaks.rs","lineNumber":602,"sourceCode":"    }\n    #[cfg(not(target_os = \"windows\"))]\n    {\n        TweaksStatus {\n            supported: false,\n            is_admin: false,\n            rules,\n        }\n    }\n}\n\n/// Aplica (`enable`) ou reverte uma regra. Guarda o valor anterior em\n/// `<app_data>/tools/win_tweaks_backup.json` para o botão \"restaurar\".\n#[allow(unused_mut, unused_variables)]\npub async fn apply(id: &str, enable: bool) -> anyhow::Result<Rule> {\n    let mut rule = rules()\n        .into_iter()\n        .find(|r| r.id == id)\n        .ok_or_else(|| anyhow!(\"regra desconhecida: {}\", id))?;\n    #[cfg(not(target_os = \"windows\"))]\n    {\n        let _ = enable;\n        let _ = &mut rule;\n        Err(anyhow!(\"esses ajustes so existem no Windows\"))\n    }\n    #[cfg(target_os = \"windows\")]\n    {\n        if rule.requires_admin && !is_admin().await {\n            return Err(anyhow!(\n                \"essa regra precisa do OmniGet aberto como administrador\"\n            ));\n        }\n        if let Some(prev) = reg_query(&rule.key, &rule.name).await {\n            backup_store(&rule.id, &prev);\n        }\n        let target = if enable {\n            rule.on.clone()","sourceCodeStart":584,"sourceCodeEnd":620,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/win_tweaks.rs#L584-L620","documentation":"A validation guard in apply: the requested tweak id does not match any rule produced by rules(), so there is no rule to enable or revert. The {} is the caller-supplied id — the fault is a stale, renamed, or fabricated rule identifier (e.g. from an outdated UI list).","triggerScenarios":"Thrown at src-tauri/omniget-core/src/core/tools/win_tweaks.rs:602 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Refresh the tweaks list and use an id that currently exists","Check for typos or trailing characters in the rule id","If the rule was removed in a newer version, use its replacement tweak"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}