Skip to content

Commit 4dde29a

Browse files
committed
Fix new clippy lints
1 parent 2d54d63 commit 4dde29a

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

src/bbcode/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pub enum BbcodeNode<'a> {
88
Text(Cow<'a, str>),
99
}
1010

11-
impl<'a> Display for BbcodeNode<'a> {
11+
impl Display for BbcodeNode<'_> {
1212
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1313
match self {
1414
BbcodeNode::Tag(node) => node.fmt(f),
@@ -26,7 +26,7 @@ pub struct BbcodeTag<'a> {
2626
simple_param: Option<Cow<'a, str>>,
2727

2828
/// Complex parameters, e.g. the map `value1` -> `xxx`, `value2` -> `yyy` for `[tag value1=”xxx” value2=”yyy”]something[/tag]`.
29-
complex_params: HashMap<Cow<'a, str>, Cow<'a, str>>,
29+
complex_params: HashMap<&'a str, Cow<'a, str>>,
3030

3131
/// The child nodes (or text) contained inside this node.
3232
children: Vec<Arc<BbcodeNode<'a>>>,
@@ -45,7 +45,7 @@ impl<'a> BbcodeTag<'a> {
4545

4646
/// Add a simple parameter to the tag.
4747
#[cfg(test)]
48-
pub fn with_simple_param<P: Into<String>>(mut self, tag_param: P) -> Self {
48+
pub fn with_simple_param<P: Into<Cow<'a, str>>>(mut self, tag_param: P) -> Self {
4949
self.simple_param = Some(tag_param.into());
5050
self
5151
}

src/bbcode/parser.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub fn parse_bbcode(input: &str) -> IResult<&str, Vec<Arc<BbcodeNode>>> {
2525

2626
fn parse_bbcode_internal<'a, E: ParseError<&'a str>>(
2727
input: &'a str,
28-
) -> IResult<&'a str, Vec<Arc<BbcodeNode>>, E> {
28+
) -> IResult<&'a str, Vec<Arc<BbcodeNode<'a>>>, E> {
2929
many0(map(parse_node, |element| element.into()))(input)
3030
}
3131

@@ -46,7 +46,9 @@ fn parse_tag<'a, E: ParseError<&'a str>>(input: &'a str) -> IResult<&'a str, Bbc
4646
Ok((input, tag))
4747
}
4848

49-
fn parse_opening_tag<'a, E: ParseError<&'a str>>(input: &'a str) -> IResult<&'a str, BbcodeTag, E> {
49+
fn parse_opening_tag<'a, E: ParseError<&'a str>>(
50+
input: &'a str,
51+
) -> IResult<&'a str, BbcodeTag<'a>, E> {
5052
let (mut input, mut tag) = map(preceded(char('['), alpha1), BbcodeTag::new)(input)?;
5153

5254
if let Ok((new_input, simple_param)) = preceded(char('='), parse_param::<E>)(input) {

src/bevy/bbcode.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use super::color::BbCodeColor;
66

77
#[derive(Debug, Clone, Component, Default)]
88
#[require(Text, BbcodeSettings)]
9-
109
pub struct Bbcode {
1110
/// The bbcode-formatted text.
1211
pub content: String,

0 commit comments

Comments
 (0)