summaryrefslogtreecommitdiffstats
path: root/src/file/source/string.rs
diff options
context:
space:
mode:
authorRadosław Kot <rdkt13@gmail.com>2021-07-31 16:59:05 +0200
committerRadosław Kot <rdkt13@gmail.com>2021-10-23 16:58:41 +0200
commit4775107810cbc7e045f075586e5061ed8aa51398 (patch)
tree3939a4c5e97fed68efbfc4485218b944b99f4502 /src/file/source/string.rs
parentabe7f7624a02261cde994d5128d44c63fe65dd60 (diff)
Satisfy clippy's type_complexity lint
Diffstat (limited to 'src/file/source/string.rs')
-rw-r--r--src/file/source/string.rs19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/file/source/string.rs b/src/file/source/string.rs
index 9bec751..700d574 100644
--- a/src/file/source/string.rs
+++ b/src/file/source/string.rs
@@ -1,7 +1,10 @@
use std::error::Error;
-use crate::file::{FileExtensions, FileSource};
-use crate::Format;
+use crate::{
+ file::source::FileSourceResult,
+ file::{FileExtensions, FileSource},
+ Format,
+};
/// Describes a file sourced from a string
#[derive(Clone, Debug)]
@@ -20,11 +23,11 @@ where
fn resolve(
&self,
format_hint: Option<F>,
- ) -> Result<(Option<String>, String, Box<dyn Format>), Box<dyn Error + Send + Sync>> {
- Ok((
- None,
- self.0.clone(),
- Box::new(format_hint.expect("from_str requires a set file format")),
- ))
+ ) -> Result<FileSourceResult, Box<dyn Error + Send + Sync>> {
+ Ok(FileSourceResult {
+ uri: None,
+ content: self.0.clone(),
+ format: Box::new(format_hint.expect("from_str requires a set file format")),
+ })
}
}