Restore rustfmt.toml and apply changes.

This commit is contained in:
Bauke 2020-08-29 16:46:54 +02:00
parent a402a632f4
commit f1a4f57ec2
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
2 changed files with 228 additions and 218 deletions

View File

@ -113,7 +113,9 @@ impl OPML {
let valid_version_regex = Regex::new(r"^\d+\.\d+$").unwrap();
let valid_versions = vec!["1.0", "1.1", "2.0"];
if !valid_version_regex.is_match(version) || !valid_versions.contains(&version.as_str()) {
if !valid_version_regex.is_match(version)
|| !valid_versions.contains(&version.as_str())
{
return Err(format!(
"Unsupported OPML version detected: {}",
opml.version
@ -192,7 +194,9 @@ impl Default for OPML {
/// The [Head](struct.Head.html) child element of [OPML](struct.OPML.html).
/// Contains the metadata of the OPML document.
#[derive(XmlWrite, XmlRead, PartialEq, Debug, Clone, Default, Serialize, Deserialize)]
#[derive(
XmlWrite, XmlRead, PartialEq, Debug, Clone, Default, Serialize, Deserialize,
)]
#[xml(tag = "head")]
pub struct Head {
/// The title of the document.
@ -249,7 +253,9 @@ pub struct Head {
}
/// The [Body](struct.Body.html) child element of [OPML](struct.OPML.html). Contains all the [Outlines](struct.Outline.html).
#[derive(XmlWrite, XmlRead, PartialEq, Debug, Clone, Default, Serialize, Deserialize)]
#[derive(
XmlWrite, XmlRead, PartialEq, Debug, Clone, Default, Serialize, Deserialize,
)]
#[xml(tag = "body")]
pub struct Body {
/// All the top-level [Outline](struct.Outline.html) elements.
@ -258,7 +264,9 @@ pub struct Body {
}
/// The [Outline](struct.Outline.html) element.
#[derive(XmlWrite, XmlRead, PartialEq, Debug, Clone, Default, Serialize, Deserialize)]
#[derive(
XmlWrite, XmlRead, PartialEq, Debug, Clone, Default, Serialize, Deserialize,
)]
#[xml(tag = "outline")]
pub struct Outline {
/// Every outline element must have at least a text attribute, which is what is displayed when an outliner opens the OPML document.

2
rustfmt.toml Normal file
View File

@ -0,0 +1,2 @@
max_width = 80
tab_spaces = 2