Skip to content

Commit

Permalink
refactor: dont derive Serialize for git database/checkout
Browse files Browse the repository at this point in the history
It doesn't seem that they need to derive `Serialize`. Is there any other
usage I am not aware of?
  • Loading branch information
weihanglo committed May 29, 2023
1 parent adc4dbd commit 45e3a86
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/cargo/sources/git/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,29 +57,24 @@ pub struct GitRemote {

/// A local clone of a remote repository's database. Multiple [`GitCheckout`]s
/// can be cloned from a single [`GitDatabase`].
#[derive(Serialize)]
pub struct GitDatabase {
/// The remote repository where this database is fetched from.
remote: GitRemote,
/// Path to the root of the underlying Git repository on the local filesystem.
path: PathBuf,
/// Underlying Git repository instance for this database.
#[serde(skip_serializing)]
repo: git2::Repository,
}

/// A local checkout of a particular revision from a [`GitDatabase`].
#[derive(Serialize)]
pub struct GitCheckout<'a> {
/// The git database where this checkout is cloned from.
database: &'a GitDatabase,
/// Path to the root of the underlying Git repository on the local filesystem.
path: PathBuf,
/// The git revision this checkout is for.
#[serde(serialize_with = "serialize_str")]
revision: git2::Oid,
/// Underlying Git repository instance for this checkout.
#[serde(skip_serializing)]
repo: git2::Repository,
}

Expand Down

0 comments on commit 45e3a86

Please sign in to comment.