8000 Rustfmt and clippy fixes for newer version of rustfmt/clippy (#566) · servo/html5ever@8415d50 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8415d50

Browse files
authored
Rustfmt and clippy fixes for newer version of rustfmt/clippy (#566)
* Update formatting to newer version of rustfmt Signed-off-by: Nico Burns <nico@nicoburns.com> * Fix clippy lints * Ignore clippy::empty_line_after_doc_comments lint Signed-off-by: Nico Burns <nico@nicoburns.com> --------- Signed-off-by: Nico Burns <nico@nicoburns.com>
1 parent 7b806cc commit 8415d50

File tree

5 files changed

+17
-9
lines changed

5 files changed

+17
-9
lines changed

html5ever/examples/arena.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,10 @@ impl<'arena> Sink<'arena> {
183183
impl<'arena> TreeSink for Sink<'arena> {
184184
type Handle = Ref<'arena>;
185185
type Output = Ref<'arena>;
186-
type ElemName<'a> = &'a QualName where Self : 'a;
186+
type ElemName<'a>
187+
= &'a QualName
188+
where
189+
Self: 'a;
187190

188191
fn finish(self) -> Ref<'arena> {
189192
self.document

markup5ever/interface/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub struct ExpandedName<'a> {
2626
pub local: &'a LocalName,
2727
}
2828

29-
impl<'a> ElemName for ExpandedName<'a> {
29+
impl ElemName for ExpandedName<'_> {
3030
#[inline(always)]
3131
fn ns(&self) -> &Namespace {
3232
self.ns
@@ -50,7 +50,7 @@ impl<'a> ElemName for Ref<'a, ExpandedName<'a>> {
5050
}
5151
}
5252

53-
impl<'a> fmt::Debug for ExpandedName<'a> {
53+
impl fmt::Debug for ExpandedName<'_> {
5454
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
5555
if self.ns.is_empty() {
5656
write!(f, "{}", self.local)
@@ -266,7 +266,7 @@ pub struct QualName {
266266
pub local: LocalName,
267267
}
268268

269-
impl<'a> ElemName for Ref<'a, QualName> {
269+
impl ElemName for Ref<'_, QualName> {
270270
#[inline(always)]
271271
fn ns(&self) -> &Namespace {
272272
&self.ns
@@ -278,7 +278,7 @@ impl<'a> ElemName for Ref<'a, QualName> {
278278
}
279279
}
280280

281-
impl<'a> ElemName for &'a QualName {
281+
impl ElemName for &QualName {
282282
#[inline(always)]
283283
fn ns(&self) -> &Namespace {
284284
&self.ns

markup5ever/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// except according to those terms.
99

1010
#![allow(unexpected_cfgs)]
11+
// This error is coming from code generated by PHF which we cannot directly fix
12+
#![allow(clippy::empty_line_after_doc_comments)]
1113

1214
pub use tendril;
1315

rcdom/lib.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,10 @@ impl TreeSink for RcDom {
225225

226226
type Handle = Handle;
227227

228-
type ElemName<'a> = ExpandedName<'a> where Self : 'a;
228+
type ElemName<'a>
229+
= ExpandedName<'a>
230+
where
231+
Self: 'a;
229232

230233
fn parse_error(&self, msg: Cow<'static, str>) {
231234
self.errors.borrow_mut().push(msg);
@@ -260,10 +263,10 @@ impl TreeSink for RcDom {
260263
}
261264

262265
fn elem_name<'a>(&self, target: &'a Handle) -> ExpandedName<'a> {
263-
return match target.data {
266+
match target.data {
264267
NodeData::Element { ref name, .. } => name.expanded(),
265268
_ => panic!("not an element!"),
266-
};
269+
}
267270
}
268271

269272
fn create_element(&self, name: QualName, attrs: Vec<Attribute>, flags: ElementFlags) -> Handle {

xml5ever/src/tokenizer/qname.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub struct QualNameTokenizer<'a> {
2020
curr_ind: usize,
2121
}
2222

23-
impl<'a> QualNameTokenizer<'a> {
23+
impl QualNameTokenizer<'_> {
2424
pub fn new(tag: &[u8]) -> QualNameTokenizer {
2525
QualNameTokenizer {
2626
state: QualNameState::BeforeName,

0 commit comments

Comments
 (0)
0