fix some clippy lints
This commit is contained in:
1 parent
76a050314a
commit
ee25c03e74
9 files changed
+25
-14
No files matched your search
@@ -76,7 +76,7 @@ pub(crate) mod innerlude {
|
||||
pub use crate::innerlude::{
|
||||
fc_to_builder, vdom_is_rendering, AnyValue, Attribute, AttributeType, AttributeValue,
|
||||
BorrowedAttributeValue, CapturedError, Component, DynamicNode, Element, ElementId, Event,
|
||||
Fragment, HasAttributesBox, IntoDynNode, LazyNodes, MountedAttribute, Mutation, Mutations,
|
||||
Fragment, HasAttributes, IntoDynNode, LazyNodes, MountedAttribute, Mutation, Mutations,
|
||||
Properties, RenderReturn, Scope, ScopeId, ScopeState, Scoped, TaskId, Template,
|
||||
TemplateAttribute, TemplateNode, VComponent, VNode, VPlaceholder, VText, VirtualDom,
|
||||
};
|
||||
@@ -89,10 +89,10 @@ pub mod prelude {
|
||||
consume_context, consume_context_from_scope, current_scope_id, fc_to_builder, has_context,
|
||||
provide_context, provide_context_to_scope, provide_root_context, push_future,
|
||||
remove_future, schedule_update_any, spawn, spawn_forever, suspend, throw, AnyValue,
|
||||
Attribute, AttributeType, Component, Element, Event, EventHandler, Fragment,
|
||||
HasAttributesBox, IntoAttributeValue, LazyNodes, MountedAttribute, Properties, Runtime,
|
||||
RuntimeGuard, Scope, ScopeId, ScopeState, Scoped, TaskId, Template, TemplateAttribute,
|
||||
TemplateNode, Throw, VNode, VirtualDom,
|
||||
Attribute, AttributeType, Component, Element, Event, EventHandler, Fragment, HasAttributes,
|
||||
IntoAttributeValue, LazyNodes, MountedAttribute, Properties, Runtime, RuntimeGuard, Scope,
|
||||
ScopeId, ScopeState, Scoped, TaskId, Template, TemplateAttribute, TemplateNode, Throw,
|
||||
VNode, VirtualDom,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -414,6 +414,7 @@ pub enum TemplateAttribute<'a> {
|
||||
},
|
||||
}
|
||||
|
||||
/// An attribute with information about its position in the DOM and the element it was mounted to
|
||||
#[derive(Debug)]
|
||||
pub struct MountedAttribute<'a> {
|
||||
pub(crate) ty: AttributeType<'a>,
|
||||
@@ -440,6 +441,12 @@ impl<'a> From<&'a [Attribute<'a>]> for MountedAttribute<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> From<&'a Vec<Attribute<'a>>> for MountedAttribute<'a> {
|
||||
fn from(attr: &'a Vec<Attribute<'a>>) -> Self {
|
||||
attr.as_slice().into()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> MountedAttribute<'a> {
|
||||
/// Get the type of this attribute
|
||||
pub fn attribute_type(&self) -> &AttributeType<'a> {
|
||||
@@ -487,8 +494,10 @@ impl<'a> Attribute<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
/// The type of an attribute
|
||||
#[derive(Debug)]
|
||||
pub enum AttributeType<'a> {
|
||||
/// A single attribute
|
||||
Single(Attribute<'a>),
|
||||
/// Many different attributes sorted by name
|
||||
Many(&'a [Attribute<'a>]),
|
||||
@@ -899,7 +908,9 @@ impl<'a, T: IntoAttributeValue<'a>> IntoAttributeValue<'a> for Option<T> {
|
||||
}
|
||||
}
|
||||
|
||||
pub trait HasAttributesBox<'a> {
|
||||
/// A trait for anything that has a dynamic list of attributes
|
||||
pub trait HasAttributes<'a> {
|
||||
/// Push an attribute onto the list of attributes
|
||||
fn push_attribute(
|
||||
self,
|
||||
name: &'a str,
|
||||
|
||||
Reference in new issue
Block a user