summaryrefslogtreecommitdiffstats
path: root/src/helpers/toml.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/helpers/toml.rs')
-rw-r--r--src/helpers/toml.rs12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/helpers/toml.rs b/src/helpers/toml.rs
index 4d23057..11f4822 100644
--- a/src/helpers/toml.rs
+++ b/src/helpers/toml.rs
@@ -4,19 +4,17 @@ use std::{
path::Path,
};
-use crate::tomlcrate;
-
use crate::data::Data;
use crate::Result;
/// Attempts to deserialize a Data struct from a string
pub fn from_str(s: &str) -> Result<Data> {
- Ok(tomlcrate::from_str(s)?)
+ Ok(toml::from_str(s)?)
}
/// Attempts to deserialize a Data struct from a slice of bytes
pub fn from_slice(s: &[u8]) -> Result<Data> {
- Ok(tomlcrate::from_slice(s)?)
+ Ok(toml::from_slice(s)?)
}
/// Attempts to deserialize a Data struct from something that implements
@@ -36,12 +34,12 @@ pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Data> {
/// Attempts to serialize a Data struct to a String
pub fn to_string(data: &Data) -> Result<String> {
- Ok(tomlcrate::to_string_pretty(data)?)
+ Ok(toml::to_string_pretty(data)?)
}
/// Attempts to serialize a Data struct to a Vec of bytes
pub fn to_vec(data: &Data) -> Result<Vec<u8>> {
- Ok(tomlcrate::to_vec(data)?)
+ Ok(toml::to_vec(data)?)
}
/// Attempts to serialize a Data struct to something that implements the
@@ -83,7 +81,7 @@ mod tests {
use std::{fs::OpenOptions, io::Cursor};
use tempfile::{tempdir, NamedTempFile};
- const DOC: &'static str = indoc!(
+ const DOC: &'static str = indoc::indoc!(
r#"
base = "https://example.com"
client_id = "adbc01234"