{"record":{"id":"6f593e53bffde835","repo":"rust-lang/rust","slug":"invalid-compression-profile-other","errorCode":null,"errorMessage":"invalid compression profile: {other}","messagePattern":"invalid compression profile: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/tools/rust-installer/src/compression.rs","lineNumber":31,"sourceCode":"#[derive(Default, Debug, Copy, Clone)]\npub enum CompressionProfile {\n    NoOp,\n    Fast,\n    #[default]\n    Balanced,\n    Best,\n}\n\nimpl FromStr for CompressionProfile {\n    type Err = Error;\n\n    fn from_str(input: &str) -> Result<Self, Error> {\n        Ok(match input {\n            \"fast\" => Self::Fast,\n            \"balanced\" => Self::Balanced,\n            \"best\" => Self::Best,\n            \"no-op\" => Self::NoOp,\n            other => anyhow::bail!(\"invalid compression profile: {other}\"),\n        })\n    }\n}\n\nimpl fmt::Display for CompressionProfile {\n    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {\n        match self {\n            CompressionProfile::Fast => f.write_str(\"fast\"),\n            CompressionProfile::Balanced => f.write_str(\"balanced\"),\n            CompressionProfile::Best => f.write_str(\"best\"),\n            CompressionProfile::NoOp => f.write_str(\"no-op\"),\n        }\n    }\n}\n\n#[derive(Debug, Copy, Clone)]\npub enum CompressionFormat {\n    Gz,","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/rust-lang/rust/blob/7088e4b63a9516ebfbfe2ab2d999cf01a528ac14/src/tools/rust-installer/src/compression.rs#L13-L49","documentation":"Thrown by CompressionProfile::from_str in the rust-installer compression module. The parser accepts exactly four strings: \"fast\", \"balanced\", \"best\", and \"no-op\" (compression.rs:26-32). Any other value is captured as {other} and causes this bail. CompressionProfile controls the compression level used when producing installer tarballs.","triggerScenarios":"Setting the compression_profile field (via CLI --compression-profile or the actor! macro's arg parsing) to a string that is not one of fast/balanced/best/no-op. For example \"speed\", \"high\", \"level9\", or an empty string.","commonSituations":"Typo in a bootstrap configuration value; using a compression level name from another tool (e.g., \"level=9\" from xz) instead of the rust-installer vocabulary; stale config from an older version that used different names.","solutions":["Set --compression-profile to one of: fast, balanced, best, no-op.","If unset, the default is Balanced (the #[default] attribute on the enum), so simply removing the explicit value also works.","Check bootstrap.example.toml or the Combiner/Tarballer arg definitions for the canonical accepted values."],"exampleFix":"# before\n--compression-profile high\n# after\n--compression-profile best","handlingStrategy":"validation","validationCode":"// Validate the profile string before passing it to the installer.\nconst VALID_PROFILES: &[&str] = &[\"fast\", \"balanced\", \"best\", \"no-op\"];\n\nfn validate_compression_profile(profile: &str) -> Result<(), String> {\n    if VALID_PROFILES.contains(&profile) {\n        Ok(())\n    } else {\n        Err(format!(\"invalid compression profile '{}': valid values are {:?}\", profile, VALID_PROFILES))\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use one of the four canonical profile names: fast, balanced, best, no-op.","If unsure, omit the flag entirely — the default is balanced.","Add a CI check that validates bootstrap configuration values against the accepted set."],"tags":["rust-installer","compression","config","cli"],"backgroundTag":null,"analyzedSha":"7088e4b63a9516ebfbfe2ab2d999cf01a528ac14","analyzedAt":"2026-08-10T14:17:03.603Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}