Skip to content

Commit

Permalink
Reduce diff further
Browse files Browse the repository at this point in the history
  • Loading branch information
konstin committed Jun 1, 2024
1 parent 1a8cd65 commit 5f95c80
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
10 changes: 8 additions & 2 deletions src/internal/arena.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,15 @@ impl<T: fmt::Debug> fmt::Debug for Arena<T> {
}
}

impl<T> Default for Arena<T> {
fn default() -> Self {
Self::new()
}
}

impl<T> Arena<T> {
pub fn new() -> Arena<T> {
Arena { data: Vec::new() }
pub fn new() -> Self {
Self { data: Vec::new() }
}

pub fn alloc(&mut self, value: T) -> Id<T> {
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@
//! do not exist in your cache.
#![warn(missing_docs)]
#![allow(clippy::all, unreachable_pub)]

pub mod error;
pub mod package;
Expand Down
2 changes: 1 addition & 1 deletion src/report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub enum DerivationTree<P: Package, VS: VersionSet, M: Eq + Clone + Debug + Disp
pub enum External<P: Package, VS: VersionSet, M: Eq + Clone + Debug + Display> {
/// Initial incompatibility aiming at picking the root package for the first decision.
NotRoot(P, VS::V),
/// There are no versions in the given set for this package. A string reason is included.
/// There are no versions in the given set for this package.
NoVersions(P, VS),
/// Incompatibility coming from the dependencies of a given package.
FromDependencyOf(P, VS, P, VS),
Expand Down
8 changes: 3 additions & 5 deletions src/solver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,11 +401,9 @@ impl<P: Package, VS: VersionSet> DependencyProvider for OfflineDependencyProvide
None => {
Dependencies::Unavailable("its dependencies could not be determined".to_string())
}
Some(dependencies) => Dependencies::Available(
dependencies
.into_iter()
.map(|(p, vs)| (p.clone(), vs.clone())),
),
Some(dependencies) => {
Dependencies::Available(dependencies.iter().map(|(p, vs)| (p.clone(), vs.clone())))
}
})
}
}

0 comments on commit 5f95c80

Please sign in to comment.