From ef4b7ea5832d325e28ed3e9d762b310e7808c656 Mon Sep 17 00:00:00 2001 From: Markus Westerlind Date: Fri, 4 Oct 2019 21:43:00 +0200 Subject: [PATCH] Implement Default for Files --- codespan/src/file.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codespan/src/file.rs b/codespan/src/file.rs index 4fad91e..a519fcb 100644 --- a/codespan/src/file.rs +++ b/codespan/src/file.rs @@ -70,7 +70,7 @@ impl fmt::Display for SpanOutOfBoundsError { pub struct FileId(u32); /// A database of source files. -#[derive(Debug, Clone)] +#[derive(Clone, Debug, Default)] pub struct Files { files: Vec, } @@ -78,7 +78,7 @@ pub struct Files { impl Files { /// Create a new, empty database of files. pub fn new() -> Files { - Files { files: Vec::new() } + Files::default() } /// Add a file to the database, returning the handle that can be used to