From f6071e9c4629f0ca8949bc8a8ffa547c16acfb32 Mon Sep 17 00:00:00 2001 From: Alexandru-Sergiu Marton Date: Tue, 1 Oct 2019 18:55:09 +0300 Subject: [PATCH] Fix "trait objects without an explicit `dyn` are deprecated" --- src/output/file_name.rs | 4 ++-- src/output/render/git.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/output/file_name.rs b/src/output/file_name.rs index c49069f..1f5f62d 100644 --- a/src/output/file_name.rs +++ b/src/output/file_name.rs @@ -16,7 +16,7 @@ pub struct FileStyle { pub classify: Classify, /// Mapping of file extensions to colours, to highlight regular files. - pub exts: Box, + pub exts: Box, } impl FileStyle { @@ -92,7 +92,7 @@ pub struct FileName<'a, 'dir: 'a, C: Colours+'a> { classify: Classify, /// Mapping of file extensions to colours, to highlight regular files. - exts: &'a FileColours, + exts: &'a dyn FileColours, } diff --git a/src/output/render/git.rs b/src/output/render/git.rs index 249eada..2124296 100644 --- a/src/output/render/git.rs +++ b/src/output/render/git.rs @@ -5,7 +5,7 @@ use fs::fields as f; impl f::Git { - pub fn render(&self, colours: &Colours) -> TextCell { + pub fn render(&self, colours: &dyn Colours) -> TextCell { TextCell { width: DisplayWidth::from(2), contents: vec![ @@ -18,7 +18,7 @@ impl f::Git { impl f::GitStatus { - fn render(&self, colours: &Colours) -> ANSIString<'static> { + fn render(&self, colours: &dyn Colours) -> ANSIString<'static> { match *self { f::GitStatus::NotModified => colours.not_modified().paint("-"), f::GitStatus::New => colours.new().paint("N"),