-
Notifications
You must be signed in to change notification settings - Fork 73
Expand file tree
/
Copy pathtag.rs
More file actions
29 lines (24 loc) · 713 Bytes
/
tag.rs
File metadata and controls
29 lines (24 loc) · 713 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//! Tag types of the distribution spec.
use bon::Builder;
use getset::{Getters, Setters};
use serde::{Deserialize, Serialize};
#[derive(Builder, Clone, Debug, Deserialize, Eq, Getters, Setters, PartialEq, Serialize)]
#[builder(on(_, into))]
#[getset(get = "pub", set = "pub")]
/// A list of tags for a given repository.
pub struct TagList {
/// The namespace of the repository.
name: String,
/// Each tags on the repository.
tags: Vec<String>,
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn tag_list_success() {
let list = TagList::builder().name("name").tags(vec![]).build();
assert!(list.tags().is_empty());
assert_eq!(list.name(), "name");
}
}