Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions src/css/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,11 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

use std::convert::TryFrom;
use std::fmt;
use std::iter::Peekable;
use std::str::CharIndices;

pub trait MyTryFrom<T>: Sized {
type Error;
fn try_from(value: T) -> Result<Self, Self::Error>;
}

#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub enum ReservedChar {
Comma,
Expand Down Expand Up @@ -90,7 +86,7 @@ impl fmt::Display for ReservedChar {
}
}

impl MyTryFrom<char> for ReservedChar {
impl TryFrom<char> for ReservedChar {
type Error = &'static str;

fn try_from(value: char) -> Result<ReservedChar, Self::Error> {
Expand Down Expand Up @@ -160,7 +156,7 @@ impl fmt::Display for Operator {
}
}

impl MyTryFrom<char> for Operator {
impl TryFrom<char> for Operator {
type Error = &'static str;

fn try_from(value: char) -> Result<Operator, Self::Error> {
Expand All @@ -175,7 +171,7 @@ impl MyTryFrom<char> for Operator {
}
}

impl MyTryFrom<ReservedChar> for Operator {
impl TryFrom<ReservedChar> for Operator {
type Error = &'static str;

fn try_from(value: ReservedChar) -> Result<Operator, Self::Error> {
Expand All @@ -197,7 +193,7 @@ pub enum SelectorElement<'a> {
Media(&'a str),
}

impl<'a> MyTryFrom<&'a str> for SelectorElement<'a> {
impl<'a> TryFrom<&'a str> for SelectorElement<'a> {
type Error = &'static str;

fn try_from(value: &'a str) -> Result<SelectorElement, Self::Error> {
Expand Down
2 changes: 1 addition & 1 deletion src/html.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ fn unquote_attributes(source: &str) -> String {
} else {
format!("{}", c)
},
caps.as_str()[1..].trim_left()
caps.as_str()[1..].trim_start()
),
);
}
Expand Down