// Precise matching:
assert_f64_eq!(a, 0.1, Steps(2))
// same as: assert!(a == 0.1.next_down().next_down())
// Number of digits (after period) that are matching:
assert_f64_eq!(a, 0.1, Digits(5))
// Relative error:
assert_f64_eq!(a, 0.1, Rel(0.5)) fn is_interior_mutability_type(type_name: &str) -> bool {
type_name.starts_with("rusty::Cell<") ||
type_name.starts_with("Cell<") ||
type_name.starts_with("rusty::RefCell<") ||
type_name.starts_with("RefCell<") ||
// Also check for std::atomic which has interior mutability
type_name.starts_with("std::atomic<") ||
type_name.starts_with("atomic<")
}
… which then 30 minutes later is being removed again because it turns out to be completely dead code: https://github.com/shuaimu/rusty-cpp/commit/84aae5eff72bb450... warning: `rusty-cpp` (bin "rusty-cpp-checker") generated 90 warnings (44 duplicates) struct slot {
uint32_t key;
uint32_t value;
} def foo
p 1
yield
p 2
end
foo { break }
This only prints "1" because the break stops the execution of the invoked method (foo). export OPENAPI_API_KEY=$(op read "op://api-prod/openai/api-key")
Every time you cd into the directory it will execute the command. Isn’t this even better than copying the secret into a local file? NAME
codesign — Create and manipulate code signatures
SYNOPSIS
codesign -s identity [-i identifier] [-r requirements] [-fv] path ...
codesign -v [-R requirement] [-v] [path|pid ...]
codesign -d [-v] [path|pid ...]
codesign -h [-v] [pid ...]
codesign --validate-constraint path ...
The first argument to codesign has to be one of -s, -v, -d, -h, --validate-constraint and in reality it's closer to a subcommand (similar to how git as pull, push, merge etc). After that "-v" works as a regular option.
That way you can just create an attic directory in any project where you can keep random stuff that should never be committed. I’ve yet to find a repo which actually has such a directory checker in.