summaryrefslogtreecommitdiffstats
path: root/src/file/source/mod.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/mod.rs
parentabe7f7624a02261cde994d5128d44c63fe65dd60 (diff)
Satisfy clippy's type_complexity lint
Diffstat (limited to 'src/file/source/mod.rs')
-rw-r--r--src/file/source/mod.rs22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/file/source/mod.rs b/src/file/source/mod.rs
index 4a8877b..cd37317 100644
--- a/src/file/source/mod.rs
+++ b/src/file/source/mod.rs
@@ -14,5 +14,25 @@ where
fn resolve(
&self,
format_hint: Option<T>,
- ) -> Result<(Option<String>, String, Box<dyn Format>), Box<dyn Error + Send + Sync>>;
+ ) -> Result<FileSourceResult, Box<dyn Error + Send + Sync>>;
+}
+
+pub struct FileSourceResult {
+ pub(crate) uri: Option<String>,
+ pub(crate) content: String,
+ pub(crate) format: Box<dyn Format>,
+}
+
+impl FileSourceResult {
+ pub fn uri(&self) -> &Option<String> {
+ &self.uri
+ }
+
+ pub fn content(&self) -> &str {
+ self.content.as_str()
+ }
+
+ pub fn format(&self) -> &dyn Format {
+ self.format.as_ref()
+ }
}