apply new rustfmt.toml changes, fix some clippy lints
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
0317cc8cc5
commit
77e0b76408
296 changed files with 7147 additions and 4300 deletions
|
@ -15,7 +15,9 @@ pub trait Between<'a> {
|
|||
|
||||
impl<'a> Between<'a> for &'a str {
|
||||
#[inline]
|
||||
fn between_infallible(&self, delim: Delim<'_>) -> &'a str { self.between(delim).unwrap_or(self) }
|
||||
fn between_infallible(&self, delim: Delim<'_>) -> &'a str {
|
||||
self.between(delim).unwrap_or(self)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn between(&self, delim: Delim<'_>) -> Option<&'a str> {
|
||||
|
|
|
@ -15,8 +15,12 @@ pub trait SplitInfallible<'a> {
|
|||
|
||||
impl<'a> SplitInfallible<'a> for &'a str {
|
||||
#[inline]
|
||||
fn rsplit_once_infallible(&self, delim: &str) -> Pair<'a> { self.rsplit_once(delim).unwrap_or((self, EMPTY)) }
|
||||
fn rsplit_once_infallible(&self, delim: &str) -> Pair<'a> {
|
||||
self.rsplit_once(delim).unwrap_or((self, EMPTY))
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn split_once_infallible(&self, delim: &str) -> Pair<'a> { self.split_once(delim).unwrap_or((self, EMPTY)) }
|
||||
fn split_once_infallible(&self, delim: &str) -> Pair<'a> {
|
||||
self.split_once(delim).unwrap_or((self, EMPTY))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,9 @@ impl<'a> Unquote<'a> for &'a str {
|
|||
}
|
||||
|
||||
#[inline]
|
||||
fn unquote(&self) -> Option<&'a str> { self.strip_prefix(QUOTE).and_then(|s| s.strip_suffix(QUOTE)) }
|
||||
fn unquote(&self) -> Option<&'a str> {
|
||||
self.strip_prefix(QUOTE).and_then(|s| s.strip_suffix(QUOTE))
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn is_quoted(&self) -> bool { self.starts_with(QUOTE) && self.ends_with(QUOTE) }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue