Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ark0f committed Feb 26, 2024
1 parent f0ad829 commit 67c74c6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,10 @@ impl Type {

fn new_with_description(s: &str, description: TypeParsingUnit) -> Result<Self> {
let default = sentence::parse_type_custom(Pattern::Default, description, |sentence| {
sentence.parts().get(0).map(|part| part.as_inner().clone())
sentence.parts().first().map(|part| part.as_inner().clone())
})?;
let min_max = sentence::parse_type_custom(Pattern::MinMax, description, |sentence| {
let values = sentence.parts().get(0)?.as_inner();
let values = sentence.parts().first()?.as_inner();
let mut split = values.split('-');
let min = split.next()?.to_string();
let max = split.next()?.to_string();
Expand Down
2 changes: 1 addition & 1 deletion src/parser/sentence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ pub(crate) fn parse_node(elem: NodeRef<Node>) -> Result<Vec<Sentence>, ParseErro
("li", _) => {
if !parts.is_empty() {
sentences.push(Sentence {
parts: parts.drain(..).collect(),
parts: mem::take(&mut parts),
});
}

Expand Down
1 change: 0 additions & 1 deletion src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ pub trait ElementRefExt {
impl ElementRefExt for ElementRef<'_> {
fn plain_text(&self) -> String {
self.traverse()
.into_iter()
.filter_map(|edge| {
if let Edge::Open(node) = edge {
return match node.value() {
Expand Down

0 comments on commit 67c74c6

Please sign in to comment.