1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! The `[[patch]]` section

use crate::dependency::Dependency;
use serde::{Deserialize, Serialize};

/// The `[[patch]]` section of `Cargo.lock`
#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
pub struct Patch {
    /// Unused patches
    pub unused: Vec<Dependency>,
}

impl Patch {
    /// Is the `[patch]` section empty?
    pub fn is_empty(&self) -> bool {
        self.unused.is_empty()
    }
}