File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ impl MediaLibrary {
4747 let content = fs:: read_to_string ( & file_path)
4848 . map_err ( |e| MediaLibraryError :: Io ( file_path. clone ( ) , e) ) ?;
4949 let meta_file: MetaMediaFile = toml:: from_str ( & content)
50- . map_err ( |e| MediaLibraryError :: Parse ( file_path. clone ( ) , e ) ) ?;
50+ . map_err ( |e| MediaLibraryError :: Parse ( file_path. clone ( ) , Box :: new ( e ) ) ) ?;
5151 Ok ( Self {
5252 entries : meta_file. media ,
5353 path : file_path,
@@ -207,7 +207,7 @@ fn extract_exif_date(path: &Path) -> Option<DateTime<Utc>> {
207207#[ derive( Debug ) ]
208208pub enum MediaLibraryError {
209209 Io ( PathBuf , io:: Error ) ,
210- Parse ( PathBuf , toml:: de:: Error ) ,
210+ Parse ( PathBuf , Box < toml:: de:: Error > ) ,
211211 Serialize ( toml:: ser:: Error ) ,
212212}
213213
Original file line number Diff line number Diff line change @@ -286,8 +286,8 @@ impl Website {
286286pub enum WebsiteError {
287287 NotASite ( PathBuf ) ,
288288 NotAPath ( PathBuf ) ,
289- Info ( WebsiteInfoError ) ,
290- MediaLibrary ( MediaLibraryError ) ,
289+ Info ( Box < WebsiteInfoError > ) ,
290+ MediaLibrary ( Box < MediaLibraryError > ) ,
291291 Io ( PathBuf , io:: Error ) ,
292292 Serialize ( toml:: ser:: Error ) ,
293293 Image ( PathBuf , image:: ImageError ) ,
@@ -344,13 +344,13 @@ impl std::error::Error for WebsiteError {}
344344
345345impl From < WebsiteInfoError > for WebsiteError {
346346 fn from ( err : WebsiteInfoError ) -> Self {
347- WebsiteError :: Info ( err)
347+ WebsiteError :: Info ( Box :: new ( err) )
348348 }
349349}
350350
351351impl From < MediaLibraryError > for WebsiteError {
352352 fn from ( err : MediaLibraryError ) -> Self {
353- WebsiteError :: MediaLibrary ( err)
353+ WebsiteError :: MediaLibrary ( Box :: new ( err) )
354354 }
355355}
356356
Original file line number Diff line number Diff line change @@ -31,8 +31,8 @@ impl WebsiteInfo {
3131 let file_path = path. join ( SITE_TOML ) ;
3232 let content = fs:: read_to_string ( & file_path)
3333 . map_err ( |e| WebsiteInfoError :: Io ( file_path. clone ( ) , e) ) ?;
34- let info: WebsiteInfo =
35- toml :: from_str ( & content ) . map_err ( |e| WebsiteInfoError :: Parse ( file_path, e ) ) ?;
34+ let info: WebsiteInfo = toml :: from_str ( & content )
35+ . map_err ( |e| WebsiteInfoError :: Parse ( file_path, Box :: new ( e ) ) ) ?;
3636 Ok ( info)
3737 }
3838}
@@ -42,7 +42,7 @@ impl WebsiteInfo {
4242#[ derive( Debug ) ]
4343pub enum WebsiteInfoError {
4444 Io ( PathBuf , io:: Error ) ,
45- Parse ( PathBuf , toml:: de:: Error ) ,
45+ Parse ( PathBuf , Box < toml:: de:: Error > ) ,
4646}
4747
4848impl std:: fmt:: Display for WebsiteInfoError {
You can’t perform that action at this time.
0 commit comments