Files
uv/crates/uv-resolver/src/dependency_mode.rs
T
Zanie Blue 2586f655bb Rename to uv (#1302)
First, replace all usages in files in-place. I used my editor for this.
If someone wants to add a one-liner that'd be fun.

Then, update directory and file names:

```
# Run twice for nested directories
find . -type d -print0 | xargs -0 rename s/puffin/uv/g
find . -type d -print0 | xargs -0 rename s/puffin/uv/g

# Update files
find . -type f -print0 | xargs -0 rename s/puffin/uv/g
```

Then add all the files again

```
# Add all the files again
git add crates
git add python/uv

# This one needs a force-add
git add -f crates/uv-trampoline
```
2024-02-15 11:19:46 -06:00

21 lines
610 B
Rust

#[derive(Debug, Default, Clone, Copy)]
pub enum DependencyMode {
/// Include all dependencies, whether direct or transitive.
#[default]
Transitive,
/// Exclude transitive dependencies, only resolving the root package's immediate dependencies.
Direct,
}
impl DependencyMode {
/// Returns `true` if transitive dependencies should be included.
pub fn is_transitive(self) -> bool {
matches!(self, Self::Transitive)
}
/// Returns `true` if (only) direct dependencies should be excluded.
pub fn is_direct(self) -> bool {
matches!(self, Self::Direct)
}
}