Skip to content

Commit e3441b3

Browse files
committed
rustfmt
1 parent b2b70f5 commit e3441b3

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

idna/src/uts46.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,14 +421,18 @@ impl Config {
421421
Some(x) => {
422422
result.push_str(PUNYCODE_PREFIX);
423423
result.push_str(&x);
424-
},
425-
None => errors.push(Error::PunycodeError)
424+
}
425+
None => errors.push(Error::PunycodeError),
426426
}
427427
}
428428
}
429429

430430
if self.verify_dns_length {
431-
let domain = if result.ends_with(".") { &result[..result.len()-1] } else { &*result };
431+
let domain = if result.ends_with(".") {
432+
&result[..result.len() - 1]
433+
} else {
434+
&*result
435+
};
432436
if domain.len() < 1 || domain.split('.').any(|label| label.len() < 1) {
433437
errors.push(Error::TooShortForDns)
434438
}
@@ -454,7 +458,6 @@ impl Config {
454458
};
455459
(domain, errors)
456460
}
457-
458461
}
459462

460463
#[derive(PartialEq, Eq, Clone, Copy, Debug)]

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,15 @@ pub use host::Host;
137137
pub use origin::{OpaqueOrigin, Origin};
138138
pub use parser::{ParseError, SyntaxViolation};
139139
pub use path_segments::PathSegmentsMut;
140-
pub use slicing::Position;
141140
pub use query_encoding::EncodingOverride;
141+
pub use slicing::Position;
142142

143143
mod host;
144144
mod origin;
145145
mod parser;
146146
mod path_segments;
147-
mod slicing;
148147
mod query_encoding;
148+
mod slicing;
149149

150150
pub mod form_urlencoded;
151151
#[doc(hidden)]

src/query_encoding.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ use std::borrow::Cow;
1010

1111
pub type EncodingOverride<'a> = Option<&'a dyn Fn(&str) -> Cow<[u8]>>;
1212

13-
pub(crate) fn encode<'a>(
14-
encoding_override: EncodingOverride,
15-
input: &'a str,
16-
) -> Cow<'a, [u8]> {
13+
pub(crate) fn encode<'a>(encoding_override: EncodingOverride, input: &'a str) -> Cow<'a, [u8]> {
1714
if let Some(o) = encoding_override {
1815
return o(input);
1916
}

0 commit comments

Comments
 (0)