Various cleanup tasks
* Remove old `extern crate` stmts * Remove rust-skeptic * Clean up Cargo.toml
This commit is contained in:
+1
-1
@@ -83,7 +83,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",
|
||||
|
||||
+5
-7
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user