๐ด match is not exhaustive โญโ[example.lis:4:3] 2 โ enum Severity { Low, High, Critical } 3 โ fn should_alert(s: Severity) -> bool { 4 โ match s { ยท โโโโฌโโโ ยท โฐโโ not all patterns covered 5 โ Severity.Low => false, 6 โ Severity.High => true, 7 โ } โฐโโโโ help: Handle the missing case Severity.Critical , e.g. Severity.Critical => { ... }
๐ด nil is not supported โญโ[users.lis:3:12] 1 โ fn find(name: string) -> Option<User> { 2 โ if name.is_empty() { 3 โ return nil ยท โโฌโ ยท โฐโโ does not exist 4 โ } 5 โ db.lookup(name) 6 โ } โฐโโโโ help: Absence is encoded with Option<T> in Lisette. Use None to represent absent values
๐ก Result is silently discarded โญโ[files.lis:7:3] 5 โ fn cleanup() -> Result<(), error> { 6 โ os.RemoveAll("cache_dir")? 7 โ os.Remove("temp.txt") ยท โโโโโโโโโโโฌโโโโโโโโโโ ยท โฐโโ failure will go unnoticed 8 โ } โฐโโโโ help: Handle this Result with ? or match , or explicitly discard it with let _ = ...
๐ก Private type Config in public API โญโ[config.lis:6:24] 5 โ struct Config { host: string, port: int } 6 โ pub fn new_config() -> Config { ยท โโโโฌโโ ยท โฐโโ private 7 โ Config { host: "localhost", port: 8080 } โฐโโโโ help: Config is private but exposed by new_config , which is public. Add pub to the private type or remove it from the public API
๐ด Immutable argument passed to mut parameter โญโ[sort.lis:5:13] 4 โ let nums = [3, 1, 2] 5 โ sort.Ints(nums) ยท โโโฌโ ยท โฐโโ expected mutable, found immutable 6 โ } โฐโโโโ help: Bindings in Lisette are immutable by default. Use let mut nums = ... to allow mutation