Skip to content

Commit 7af045a

Browse files
committed
refactor(add): Clarify DepednencyEx's name
1 parent 41413b3 commit 7af045a

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/cargo/ops/cargo_add/mod.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ fn resolve_dependency(
203203
section: &DepTable,
204204
config: &Config,
205205
registry: &mut PackageRegistry<'_>,
206-
) -> CargoResult<DependencyEx> {
206+
) -> CargoResult<DependencyUI> {
207207
let crate_spec = arg
208208
.crate_spec
209209
.as_deref()
@@ -599,13 +599,13 @@ fn populate_dependency(mut dependency: Dependency, arg: &DepOp) -> Dependency {
599599
dependency
600600
}
601601

602-
pub struct DependencyEx {
602+
pub struct DependencyUI {
603603
dep: Dependency,
604604
available_version: Option<semver::Version>,
605605
available_features: BTreeMap<String, Vec<String>>,
606606
}
607607

608-
impl DependencyEx {
608+
impl DependencyUI {
609609
fn new(dep: Dependency) -> Self {
610610
Self {
611611
dep,
@@ -634,7 +634,7 @@ impl DependencyEx {
634634
}
635635
}
636636

637-
impl<'s> From<&'s Summary> for DependencyEx {
637+
impl<'s> From<&'s Summary> for DependencyUI {
638638
fn from(other: &'s Summary) -> Self {
639639
let dep = Dependency::from(other);
640640
let mut dep = Self::new(dep);
@@ -643,13 +643,13 @@ impl<'s> From<&'s Summary> for DependencyEx {
643643
}
644644
}
645645

646-
impl std::fmt::Display for DependencyEx {
646+
impl std::fmt::Display for DependencyUI {
647647
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
648648
self.dep.fmt(f)
649649
}
650650
}
651651

652-
impl std::ops::Deref for DependencyEx {
652+
impl std::ops::Deref for DependencyUI {
653653
type Target = Dependency;
654654

655655
fn deref(&self) -> &Self::Target {
@@ -662,8 +662,8 @@ fn populate_available_features(
662662
dependency: Dependency,
663663
query: &crate::core::dependency::Dependency,
664664
registry: &mut PackageRegistry<'_>,
665-
) -> CargoResult<DependencyEx> {
666-
let mut dependency = DependencyEx::new(dependency);
665+
) -> CargoResult<DependencyUI> {
666+
let mut dependency = DependencyUI::new(dependency);
667667

668668
if !dependency.available_features.is_empty() {
669669
return Ok(dependency);
@@ -695,7 +695,7 @@ fn populate_available_features(
695695
Ok(dependency)
696696
}
697697

698-
fn print_msg(shell: &mut Shell, dep: &DependencyEx, section: &[String]) -> CargoResult<()> {
698+
fn print_msg(shell: &mut Shell, dep: &DependencyUI, section: &[String]) -> CargoResult<()> {
699699
use std::fmt::Write;
700700

701701
if matches!(shell.verbosity(), crate::core::shell::Verbosity::Quiet) {

0 commit comments

Comments
 (0)