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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//! Generic constructors for newtypes

#![allow(non_snake_case)]

use crate::{Font as FontType, Label as LabelType, Output as OutputType, Title as TitleType};
use std::borrow::Cow;
use std::path::Path;

/// Generic constructor for `Font`
#[cfg_attr(feature = "cargo-clippy", allow(clippy::inline_always))]
#[inline(always)]
pub fn Font<S>(string: S) -> FontType
where
    S: Into<Cow<'static, str>>,
{
    FontType(string.into())
}

/// Generic constructor for `Label`
#[cfg_attr(feature = "cargo-clippy", allow(clippy::inline_always))]
#[inline(always)]
pub fn Label<S>(string: S) -> LabelType
where
    S: Into<Cow<'static, str>>,
{
    LabelType(string.into())
}

/// Generic constructor for `Title`
#[cfg_attr(feature = "cargo-clippy", allow(clippy::inline_always))]
#[inline(always)]
pub fn Title<S>(string: S) -> TitleType
where
    S: Into<Cow<'static, str>>,
{
    TitleType(string.into())
}

/// Generic constructor for `Output`
#[cfg_attr(feature = "cargo-clippy", allow(clippy::inline_always))]
#[inline(always)]
pub fn Output<P>(path: P) -> OutputType
where
    P: Into<Cow<'static, Path>>,
{
    OutputType(path.into())
}