Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .rustfmt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ struct_lit_width = 30
# -----------------------------------------------------------------------------

# Set the 2021 edition for consistency, which is necessary, since `rustfmt`
# and `rust-analyzer` current behave differently causing jumpy formatting
# and `rust-analyzer` currently behave differently causing jumpy formatting
style_edition = "2021"
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions crates/mono-changeset/src/changeset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,11 @@ pub mod revision;
pub mod scopes;

use change::Change;
use config::Config;
pub use error::{Error, Result};
use revision::Revision;
use scopes::Scopes;

use crate::changeset::config::Config;

// ----------------------------------------------------------------------------
// Structs
// ----------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions crates/mono-changeset/src/changeset/change.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl Change {
/// ```
#[must_use]
pub fn as_increment(&self) -> Option<Increment> {
let increment = match self.kind() {
let increment = match self.kind {
Kind::Feature => Increment::Minor,
Kind::Fix => Increment::Patch,
Kind::Performance => Increment::Patch,
Expand All @@ -83,7 +83,7 @@ impl Change {

// If a version increment is determined, check for breaking changes,
// as they must always lead to a major version increment
if self.is_breaking() {
if self.is_breaking {
Some(Increment::Major)
} else {
Some(increment)
Expand Down
3 changes: 1 addition & 2 deletions crates/mono-changeset/src/changeset/revision.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ impl<'a> Changeset<'a> {
/// it into the changeset, e.g., merge commits.
///
/// [`Error::Repository`]: crate::changeset::Error::Repository
#[allow(clippy::missing_panics_doc)]
pub fn add(&mut self, commit: Commit<'a>) -> Result {
if let Ok(change) = Change::from_str(commit.summary()) {
// Retrieve affected scopes from commit
Expand Down Expand Up @@ -167,6 +166,6 @@ fn parse_issues(body: &str) -> BTreeSet<u32> {
.and_then(|num| num.parse().ok())
});

// Collect issue numbers into set to avoid duplicates
// Collect issue references into set to avoid duplicates
iter.collect()
}
2 changes: 1 addition & 1 deletion crates/mono-project/src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ where
T: Manifest,
{
type Item = Result<Project<T>>;
type IntoIter = Chain<Once<Result<Project<T>>>, Members<T>>;
type IntoIter = Chain<Once<Self::Item>, Members<T>>;

/// Creates an iterator over the project and its members.
#[inline]
Expand Down
4 changes: 2 additions & 2 deletions crates/mono-project/src/project/manifest/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ use model::{Dependency, Package, Workspace};
///
/// Note that we only read parts of the manifest relevant to our use case, as
/// we're solely interested in identifying package name, version, and workspace
/// members, in order to bump versions. Other fields can be safely ignored, so
/// we don't model them here.
/// members, and dependencies, in order to bump versions. Other fields can be
/// safely ignored, so we don't model them here.
#[derive(Debug, Deserialize)]
#[serde(untagged)]
pub enum Cargo {
Expand Down
15 changes: 0 additions & 15 deletions crates/mono-project/src/project/manifest/cargo/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,3 @@ pub struct Package {
/// Package version.
pub version: Version,
}

// ----------------------------------------------------------------------------
// Implementations
// ----------------------------------------------------------------------------

impl Dependency {
/// Returns the version requirement.
#[must_use]
pub fn version(&self) -> Option<&VersionReq> {
match self {
Dependency::Version(version) => Some(version),
Dependency::Info { version } => version.as_ref(),
}
}
}
4 changes: 2 additions & 2 deletions crates/mono-project/src/project/manifest/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ mod versions;
///
/// Note that we only read parts of the manifest relevant to our use case, as
/// we're solely interested in identifying package name, version, and workspace
/// members, in order to bump versions. Other fields can be safely ignored, so
/// we don't model them here.
/// members, and dependencies, in order to bump versions. Other fields can be
/// safely ignored, so we don't model them here.
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Node {
Expand Down
6 changes: 3 additions & 3 deletions crates/mono-project/src/project/members/paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

// ----------------------------------------------------------------------------

//! Iterator over resolved paths of a glob.
//! Iterator over resolved paths of globs.

use glob::glob;
use std::path::PathBuf;
Expand All @@ -34,7 +34,7 @@ use crate::project::Result;
// Structs
// ----------------------------------------------------------------------------

/// Iterator over resolved paths of a glob.
/// Iterator over resolved paths of globs.
#[derive(Debug, Default)]
pub struct Paths {
/// Stack of patterns.
Expand Down Expand Up @@ -82,7 +82,7 @@ impl Iterator for Paths {
// ----------------------------------------------------------------------------

impl FromIterator<PathBuf> for Paths {
/// Creates an iterator from an iterator over patterns.
/// Creates an iterator over resolved paths of globs from patterns.
///
/// Note that the given patterns must be valid paths and resolvable from
/// the current working directory. It's recommended to use absolute paths.
Expand Down
20 changes: 0 additions & 20 deletions crates/mono-project/src/project/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,6 @@ where
pub fn iter(&self) -> Values<'_, PathBuf, Project<T>> {
self.into_iter()
}

/// Creates a mutable iterator over the workspace.
#[inline]
pub fn iter_mut(&mut self) -> ValuesMut<'_, PathBuf, Project<T>> {
self.into_iter()
}
}

// ----------------------------------------------------------------------------
Expand All @@ -162,17 +156,3 @@ where
self.projects.values()
}
}

impl<'a, T> IntoIterator for &'a mut Workspace<T>
where
T: Manifest,
{
type Item = &'a mut Project<T>;
type IntoIter = ValuesMut<'a, PathBuf, Project<T>>;

/// Creates a mutable iterator over the workspace.
#[inline]
fn into_iter(self) -> Self::IntoIter {
self.projects.values_mut()
}
}