I change themes frequently during my Terminal sessions in alacritty. For base16 themes, there is also a lot of overlap between themes used by the terminal as well as themes used by vim.
This tool is just a small little wrapper that will allow theme changes.
- Pattern matching (need to learn more patterns of Pattern Matching!)
log
undenv_logger
std::fs::read_dir
- Splitting up a chain of
.unwrap()
into let bindings to resolve borrow-checker errors. const
types need types to be provided..collect<T>()
whereT
can beVec<&str>
or other types. AKA.collect<Vec<&str>>()
.s("foo")
convenience fn which internally does.to_string()
(reduces noise)- Single match can be just a
let
statement, as perClippy
(variable pattern matching like Python) &String
can usually be converted to&str
, and Clippy will remind you of this. So use him!fold_ok
: Does afold
over an input collection ofOption
types.fold
has an accumulator. If there is aNone
that is encountered, we can choose to just skip over it..is_ok()
can be used instead of redundant single-useif let Ok(_)
statements.- There are only limited things we can do when defining
const
values:calls in constants are limited to constant functions, tuple structs and tuple variants
- How does the
use
statement work? Does it matter if we adduse
in a method call and don't hoist it to the top? - When should we decide b/w using
&str
andString
types? .clone()
: when to use and how to avoid.pattern-matching
with variables: possible if we have anif pattern == variable
in our arms.- What is a
constant function
?