### Create New Painted Instance Source: https://docs.rs/deadnix/1.3.1/deadnix/struct.Settings.html Creates a new `Painted` instance with a default style. This is the starting point for applying styles. ```rust fn new(self) -> Painted where Self: Sized, Create a new `Painted` with a default `Style`. Read more ``` -------------------------------- ### Binding::starts_with_underscore Source: https://docs.rs/deadnix/1.3.1/src/deadnix/binding.rs.html Determines if the binding's name starts with an underscore, indicating an anonymous variable. ```APIDOC /// Does the name start with `_`, signifying an anonymous /// variable? pub fn starts_with_underscore(&self) -> bool ``` -------------------------------- ### Find dead code in Nix files Source: https://docs.rs/deadnix/1.3.1/src/deadnix/lib.rs.html Use the `Settings` struct to configure dead code detection and then call `find_dead_code` with the parsed Nix syntax tree. This example demonstrates how to print the names of unused bindings. ```rust let content = " let foo = {}; inherit (foo) bar baz; in baz "; let ast = rnix::Root::parse(content); assert_eq!(0, ast.errors().len()); let results = deadnix::Settings { no_lambda_arg: false, no_lambda_pattern_names: false, no_underscore: false, warn_used_underscore: false, }.find_dead_code(&ast.syntax()); for dead_code in &results { println!("unused binding: {}", dead_code.binding.name); } ``` -------------------------------- ### Check if Binding Name Starts with Underscore Source: https://docs.rs/deadnix/1.3.1/deadnix/struct.Binding.html Identifies if the binding's name begins with an underscore, which typically signifies an anonymous variable. ```rust pub fn starts_with_underscore(&self) -> bool ``` -------------------------------- ### Conditionally Enable Styling Source: https://docs.rs/deadnix/1.3.1/deadnix/struct.Binding.html Conditionally enables styling based on a `Condition`. This example shows enabling styling only when both stdout and stderr are TTYs. ```rust use yansi::{Paint, Condition}; painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY); ``` -------------------------------- ### Initialization and Styling Source: https://docs.rs/deadnix/1.3.1/deadnix/struct.Binding.html Methods for creating and applying styles. ```APIDOC ## fn new(self) -> Painted where Self: Sized, Create a new `Painted` with a default `Style`. Read more ## fn paint(&self, style: S) -> Painted<&Self> where S: Into