Upgrade to Rust 1.17.
- Remove some uses of 'static in const and static globals that are no longer needed. - Use the new struct initialization shorthand.
This commit is contained in:
@@ -25,7 +25,7 @@ enum Directive {
|
||||
// 1. Keyword.
|
||||
// 2. Rest of line / pattern.
|
||||
//
|
||||
const DIRECTIVE_RX: &'static str = r"\b(check|sameln|nextln|unordered|not|regex):\s+(.*)";
|
||||
const DIRECTIVE_RX: &str = r"\b(check|sameln|nextln|unordered|not|regex):\s+(.*)";
|
||||
|
||||
impl Directive {
|
||||
/// Create a new directive from a `DIRECTIVE_RX` match.
|
||||
@@ -264,9 +264,9 @@ struct State<'a> {
|
||||
impl<'a> State<'a> {
|
||||
fn new(text: &'a str, env_vars: &'a VariableMap, recorder: &'a mut Recorder) -> State<'a> {
|
||||
State {
|
||||
text: text,
|
||||
env_vars: env_vars,
|
||||
recorder: recorder,
|
||||
text,
|
||||
env_vars,
|
||||
recorder,
|
||||
vars: HashMap::new(),
|
||||
last_ordered: 0,
|
||||
max_match: 0,
|
||||
|
||||
@@ -60,7 +60,7 @@ pub struct Explainer<'a> {
|
||||
impl<'a> Explainer<'a> {
|
||||
pub fn new(text: &'a str) -> Explainer {
|
||||
Explainer {
|
||||
text: text,
|
||||
text,
|
||||
directive: 0,
|
||||
matches: Vec::new(),
|
||||
vardefs: Vec::new(),
|
||||
|
||||
Reference in New Issue
Block a user