Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fixed the should_implement_trait clippy warning
  • Loading branch information
ZapAnton committed Feb 12, 2019
commit 00cfa47f6401ad09d9871434332a81e1f60783ca
6 changes: 5 additions & 1 deletion vm/src/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -496,8 +496,12 @@ impl FormatString {
None => Err(FormatParseError::UnmatchedBracket),
}
}
}

impl FromStr for FormatString {
type Err = FormatParseError;

pub fn from_str(text: &str) -> Result<FormatString, FormatParseError> {
fn from_str(text: &str) -> Result<Self, Self::Err> {
let mut cur_text: &str = text;
let mut parts: Vec<FormatPart> = Vec::new();
while !cur_text.is_empty() {
Expand Down
1 change: 1 addition & 0 deletions vm/src/obj/objstr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use super::objtype;
use num_traits::ToPrimitive;
use std::hash::{Hash, Hasher};
use std::ops::Range;
use std::str::FromStr;
// rust's builtin to_lowercase isn't sufficient for casefold
extern crate caseless;
extern crate unicode_segmentation;
Expand Down