π΄ 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