Skip to main content

nanite_docker/instruction/
maintainer.rs

1use alloc::string::String;
2use core::fmt::{Display, Formatter};
3
4/// Represents a `MAINTAINER` instruction.
5/// > WARNING: THE MAINTAINER INSTRUCTION IS DEPRECATED. FOR PARITY TO DOCKER, IT IS LEFT IN BUT PLEASE USE THE LABEL INSTRUCTION INSTEAD.
6/// > SEE <https://docs.docker.com/reference/dockerfile/#maintainer-deprecated> FOR MORE DETAILS.
7/// ```rust
8/// use nanite_docker::Maintainer;
9/// let maintainer = Maintainer {
10///     name: "John Doe".to_string(),
11/// };
12/// let maintainer_built = format!("{maintainer}");
13/// assert_eq!(maintainer_built, "MAINTAINER John Doe");
14/// ```
15#[derive(Clone, Debug)]
16pub struct Maintainer {
17    pub name: String,
18}
19
20impl Display for Maintainer {
21    fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
22        write!(f, "MAINTAINER {}", self.name)
23    }
24}