Fix clippy.
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
use std::collections::HashMap;
|
||||
|
||||
use serde::Deserialize;
|
||||
@@ -31,12 +30,6 @@ pub struct AdditionalProperties {
|
||||
pub(crate) properties: HashMap<String, AdditionalPropertyValue>,
|
||||
}
|
||||
|
||||
impl AdditionalProperties {
|
||||
pub(crate) fn get_elisp_names<'c>(&'c self) -> impl Iterator<Item = String> + 'c {
|
||||
self.properties.keys().map(move |key| format!(":{}", key))
|
||||
}
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
AdditionalProperties,
|
||||
AffiliatedKeywords<'s>,
|
||||
|
||||
@@ -8,8 +8,8 @@ use super::additional_property::AdditionalPropertyValue;
|
||||
use super::ast_node::WasmAstNode;
|
||||
use super::macros::to_wasm;
|
||||
use super::to_wasm::ToWasm;
|
||||
use crate::util::elisp_fact::ElispFact;
|
||||
use crate::types::Document;
|
||||
use crate::util::elisp_fact::ElispFact;
|
||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
@@ -29,7 +29,7 @@ to_wasm!(
|
||||
{ WasmAstNode::Document(original) },
|
||||
{ "org-data".into() },
|
||||
{
|
||||
let category = original.category.as_ref().map(String::as_str);
|
||||
let category = original.category.as_deref();
|
||||
let path = original.path.clone();
|
||||
|
||||
let mut additional_properties = AdditionalProperties::default();
|
||||
|
||||
@@ -8,12 +8,12 @@ use super::src_block::WasmNumberLinesWrapper;
|
||||
use super::src_block::WasmRetainLabels;
|
||||
use super::to_wasm::ToWasm;
|
||||
use super::AdditionalProperties;
|
||||
use crate::util::elisp_fact::ElispFact;
|
||||
use crate::types::CharOffsetInLine;
|
||||
use crate::types::ExampleBlock;
|
||||
use crate::types::GetAffiliatedKeywords;
|
||||
use crate::types::RetainLabels;
|
||||
use crate::types::SwitchNumberLines;
|
||||
use crate::util::elisp_fact::ElispFact;
|
||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
@@ -58,7 +58,7 @@ to_wasm!(
|
||||
inner: WasmNumberLines::New(n),
|
||||
}),
|
||||
Some(SwitchNumberLines::Continued(n)) => Some(WasmNumberLinesWrapper {
|
||||
inner: WasmNumberLines::continued(n),
|
||||
inner: WasmNumberLines::Continued(n),
|
||||
}),
|
||||
},
|
||||
preserve_indent: original.preserve_indent,
|
||||
|
||||
@@ -6,11 +6,11 @@ use super::macros::to_wasm;
|
||||
use super::to_wasm::ToWasm;
|
||||
use super::AdditionalProperties;
|
||||
use super::AdditionalPropertyValue;
|
||||
use crate::util::elisp_fact::ElispFact;
|
||||
use crate::types::Heading;
|
||||
use crate::types::HeadlineLevel;
|
||||
use crate::types::PriorityCookie;
|
||||
use crate::types::TodoKeywordType;
|
||||
use crate::util::elisp_fact::ElispFact;
|
||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
@@ -112,7 +112,7 @@ to_wasm!(
|
||||
.map(Into::<WasmAstNode>::into)
|
||||
})
|
||||
.map_or(Ok(None), |r| r.map(Some))?
|
||||
.map(|child| Box::new(child)),
|
||||
.map(Box::new),
|
||||
deadline: original
|
||||
.deadline
|
||||
.as_ref()
|
||||
@@ -122,7 +122,7 @@ to_wasm!(
|
||||
.map(Into::<WasmAstNode>::into)
|
||||
})
|
||||
.map_or(Ok(None), |r| r.map(Some))?
|
||||
.map(|child| Box::new(child)),
|
||||
.map(Box::new),
|
||||
closed: original
|
||||
.closed
|
||||
.as_ref()
|
||||
@@ -132,7 +132,7 @@ to_wasm!(
|
||||
.map(Into::<WasmAstNode>::into)
|
||||
})
|
||||
.map_or(Ok(None), |r| r.map(Some))?
|
||||
.map(|child| Box::new(child)),
|
||||
.map(Box::new),
|
||||
pre_blank: Noop {},
|
||||
},
|
||||
))
|
||||
|
||||
@@ -23,6 +23,7 @@ macro_rules! to_wasm {
|
||||
&self,
|
||||
$wasm_context: crate::wasm::to_wasm::ToWasmContext<'_>,
|
||||
) -> Result<Self::Output, crate::error::CustomError> {
|
||||
#[allow(unused_variables)]
|
||||
let $original = self;
|
||||
let standard_properties =
|
||||
self.to_wasm_standard_properties($wasm_context.clone())?;
|
||||
@@ -38,9 +39,8 @@ macro_rules! to_wasm {
|
||||
}
|
||||
}
|
||||
|
||||
impl Into<WasmAstNode> for crate::wasm::ast_node::WasmAstNodeWrapper<$ostruct> {
|
||||
fn into(self) -> WasmAstNode {
|
||||
let $original = self;
|
||||
impl From<crate::wasm::ast_node::WasmAstNodeWrapper<$ostruct>> for WasmAstNode {
|
||||
fn from($original: crate::wasm::ast_node::WasmAstNodeWrapper<$ostruct>) -> Self {
|
||||
let ret = $toastnodebody;
|
||||
ret
|
||||
}
|
||||
@@ -48,7 +48,6 @@ macro_rules! to_wasm {
|
||||
|
||||
impl<'s> crate::util::elisp_fact::ElispFact<'s> for $ostruct {
|
||||
fn get_elisp_name<'b>(&'b self) -> std::borrow::Cow<'s, str> {
|
||||
let $original = self;
|
||||
let ret = $elispnamebody;
|
||||
ret
|
||||
}
|
||||
|
||||
@@ -4,11 +4,11 @@ use serde::Serialize;
|
||||
use super::ast_node::WasmAstNode;
|
||||
use super::macros::to_wasm;
|
||||
use super::to_wasm::ToWasm;
|
||||
use crate::util::elisp_fact::ElispFact;
|
||||
use crate::types::CheckboxType;
|
||||
use crate::types::PlainListItem;
|
||||
use crate::types::PlainListItemCounter;
|
||||
use crate::types::PlainListItemPreBlank;
|
||||
use crate::util::elisp_fact::ElispFact;
|
||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
@@ -52,7 +52,7 @@ to_wasm!(
|
||||
})
|
||||
.collect::<Result<Vec<_>, _>>()?,
|
||||
bullet: original.bullet.to_owned(),
|
||||
counter: original.counter.clone(),
|
||||
counter: original.counter,
|
||||
checkbox: original.checkbox.as_ref().map(|(checkbox_type, _)| {
|
||||
match checkbox_type {
|
||||
CheckboxType::On => "on",
|
||||
|
||||
@@ -4,8 +4,8 @@ use serde::Serialize;
|
||||
use super::ast_node::WasmAstNode;
|
||||
use super::macros::to_wasm;
|
||||
use super::to_wasm::ToWasm;
|
||||
use crate::util::elisp_fact::ElispFact;
|
||||
use crate::types::PlainText;
|
||||
use crate::util::elisp_fact::ElispFact;
|
||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
|
||||
@@ -4,8 +4,8 @@ use serde::Serialize;
|
||||
use super::ast_node::WasmAstNode;
|
||||
use super::macros::to_wasm;
|
||||
use super::to_wasm::ToWasm;
|
||||
use crate::util::elisp_fact::ElispFact;
|
||||
use crate::types::Planning;
|
||||
use crate::util::elisp_fact::ElispFact;
|
||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
@@ -35,7 +35,7 @@ to_wasm!(
|
||||
.map(Into::<WasmAstNode>::into)
|
||||
})
|
||||
.map_or(Ok(None), |r| r.map(Some))?
|
||||
.map(|child| Box::new(child)),
|
||||
.map(Box::new),
|
||||
deadline: original
|
||||
.deadline
|
||||
.as_ref()
|
||||
@@ -45,7 +45,7 @@ to_wasm!(
|
||||
.map(Into::<WasmAstNode>::into)
|
||||
})
|
||||
.map_or(Ok(None), |r| r.map(Some))?
|
||||
.map(|child| Box::new(child)),
|
||||
.map(Box::new),
|
||||
closed: original
|
||||
.closed
|
||||
.as_ref()
|
||||
@@ -55,7 +55,7 @@ to_wasm!(
|
||||
.map(Into::<WasmAstNode>::into)
|
||||
})
|
||||
.map_or(Ok(None), |r| r.map(Some))?
|
||||
.map(|child| Box::new(child)),
|
||||
.map(Box::new),
|
||||
},
|
||||
))
|
||||
}
|
||||
|
||||
@@ -5,13 +5,13 @@ use super::ast_node::WasmAstNode;
|
||||
use super::macros::to_wasm;
|
||||
use super::to_wasm::ToWasm;
|
||||
use super::AdditionalProperties;
|
||||
use crate::util::elisp_fact::ElispFact;
|
||||
use crate::types::CharOffsetInLine;
|
||||
use crate::types::GetAffiliatedKeywords;
|
||||
use crate::types::LineNumber;
|
||||
use crate::types::RetainLabels;
|
||||
use crate::types::SrcBlock;
|
||||
use crate::types::SwitchNumberLines;
|
||||
use crate::util::elisp_fact::ElispFact;
|
||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
@@ -46,7 +46,7 @@ pub(crate) enum WasmNumberLines {
|
||||
#[serde(rename = "new")]
|
||||
New(LineNumber),
|
||||
#[serde(rename = "continued")]
|
||||
continued(LineNumber),
|
||||
Continued(LineNumber),
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
@@ -83,7 +83,7 @@ to_wasm!(
|
||||
inner: WasmNumberLines::New(n),
|
||||
}),
|
||||
Some(SwitchNumberLines::Continued(n)) => Some(WasmNumberLinesWrapper {
|
||||
inner: WasmNumberLines::continued(n),
|
||||
inner: WasmNumberLines::Continued(n),
|
||||
}),
|
||||
},
|
||||
preserve_indent: original.preserve_indent,
|
||||
|
||||
@@ -7,9 +7,9 @@ use super::ast_node::WasmAstNode;
|
||||
use super::macros::to_wasm;
|
||||
use super::to_wasm::ToWasm;
|
||||
use super::AdditionalProperties;
|
||||
use crate::util::elisp_fact::ElispFact;
|
||||
use crate::types::GetAffiliatedKeywords;
|
||||
use crate::types::Table;
|
||||
use crate::util::elisp_fact::ElispFact;
|
||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
@@ -26,7 +26,7 @@ pub struct WasmTable {
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
#[serde(tag = "string-set")]
|
||||
#[serde(rename = "string-set")]
|
||||
struct WasmStringSet {
|
||||
pub(crate) struct WasmStringSet {
|
||||
value: BTreeSet<String>,
|
||||
}
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@ use super::ast_node::WasmAstNode;
|
||||
use super::macros::to_wasm;
|
||||
use super::to_wasm::ToWasm;
|
||||
use super::AdditionalProperties;
|
||||
use crate::util::elisp_fact::ElispFact;
|
||||
use crate::types::GetAffiliatedKeywords;
|
||||
use crate::types::VerseBlock;
|
||||
use crate::util::elisp_fact::ElispFact;
|
||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
|
||||
Reference in New Issue
Block a user