Skip to content

Commit a37b9cf

Browse files
committed
style: Group File methods
1 parent ca1d741 commit a37b9cf

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

src/file/mod.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,23 @@ impl File<FileSourceFile, FileFormat> {
7676
}
7777
}
7878

79+
impl<T, F> File<T, F>
80+
where
81+
F: FileStoredFormat + 'static,
82+
T: FileSource<F>,
83+
{
84+
pub fn format(mut self, format: F) -> Self {
85+
self.format = Some(format);
86+
self
87+
}
88+
89+
/// Set required to false to make a file optional when building the config.
90+
pub fn required(mut self, required: bool) -> Self {
91+
self.required = required;
92+
self
93+
}
94+
}
95+
7996
impl<'a> From<&'a Path> for File<FileSourceFile, FileFormat> {
8097
fn from(path: &'a Path) -> Self {
8198
Self {
@@ -96,23 +113,6 @@ impl From<PathBuf> for File<FileSourceFile, FileFormat> {
96113
}
97114
}
98115

99-
impl<T, F> File<T, F>
100-
where
101-
F: FileStoredFormat + 'static,
102-
T: FileSource<F>,
103-
{
104-
pub fn format(mut self, format: F) -> Self {
105-
self.format = Some(format);
106-
self
107-
}
108-
109-
/// Set required to false to make a file optional when building the config.
110-
pub fn required(mut self, required: bool) -> Self {
111-
self.required = required;
112-
self
113-
}
114-
}
115-
116116
impl<T, F> Source for File<T, F>
117117
where
118118
F: FileStoredFormat + Debug + Clone + Send + Sync + 'static,

0 commit comments

Comments
 (0)