summaryrefslogtreecommitdiffstats
path: root/src/file/format/mod.rs
diff options
context:
space:
mode:
authorFederico Pasqua <federico.pasqua.96@gmail.com>2020-03-14 15:46:36 +0100
committerFederico Pasqua <federico.pasqua.96@gmail.com>2020-03-14 16:01:54 +0100
commit57fb2610ad274dff1d2f2e4d43dfce05ca9c4835 (patch)
tree45e4c5c57df0eea23e8977de0984965d9a8a56b4 /src/file/format/mod.rs
parent2c0b201055be60ec45e258adcc6c4b6e01bcd627 (diff)
General upgrade for clippy fix and remove of deprecated methods for errors
Diffstat (limited to 'src/file/format/mod.rs')
-rw-r--r--src/file/format/mod.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/file/format/mod.rs b/src/file/format/mod.rs
index 39b3813..f46ae13 100644
--- a/src/file/format/mod.rs
+++ b/src/file/format/mod.rs
@@ -72,22 +72,22 @@ lazy_static! {
impl FileFormat {
// TODO: pub(crate)
#[doc(hidden)]
- pub fn extensions(&self) -> &'static Vec<&'static str> {
+ pub fn extensions(self) -> &'static Vec<&'static str> {
// It should not be possible for this to fail
// A FileFormat would need to be declared without being added to the
// ALL_EXTENSIONS map.
- ALL_EXTENSIONS.get(self).unwrap()
+ ALL_EXTENSIONS.get(&self).unwrap()
}
// TODO: pub(crate)
#[doc(hidden)]
#[allow(unused_variables)]
pub fn parse(
- &self,
+ self,
uri: Option<&String>,
text: &str,
- ) -> Result<HashMap<String, Value>, Box<Error + Send + Sync>> {
- match *self {
+ ) -> Result<HashMap<String, Value>, Box<dyn Error + Send + Sync>> {
+ match self {
#[cfg(feature = "toml")]
FileFormat::Toml => toml::parse(uri, text),