Skip to content

Commit

Permalink
remove unneeded static keyword
Browse files Browse the repository at this point in the history
statics have a default static lifetime
  • Loading branch information
jqnatividad committed Sep 27, 2021
1 parent 850f3a8 commit c044e4c
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/cmd/apply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::select::SelectColumns;
use crate::util;
use crate::serde::Deserialize;

static USAGE: &'static str = "
static USAGE: &str = "
Apply a series of unary functions to a given CSV column. This can be used to
perform typical cleaning tasks and/or harmonize some values etc.
Expand Down Expand Up @@ -51,7 +51,7 @@ Common options:
Must be a single character. (default: ,)
";

static OPERATIONS: &'static [&'static str] = &[
static OPERATIONS: &[&str] = &[
"len",
"lower",
"upper",
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/behead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::config::{Delimiter, Config};
use crate::util;
use serde::Deserialize;

static USAGE: &'static str = "
static USAGE: &str = "
Drop a CSV file's header.
Usage:
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/explode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::select::SelectColumns;
use crate::util;
use serde::Deserialize;

static USAGE: &'static str = "
static USAGE: &str = "
Explodes a row into multiple ones by splitting a column value based on the
given separator.
Expand Down
4 changes: 2 additions & 2 deletions src/cmd/foreach.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::select::SelectColumns;
use crate::util;
use serde::Deserialize;

static USAGE: &'static str = "
static USAGE: &str = "
Execute a bash command once per line in given CSV file.
Deleting all files whose filenames are listed in a column:
Expand Down Expand Up @@ -81,6 +81,7 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
let mut record = csv::ByteRecord::new();
let mut output_headers_written = false;

#[cfg(target_family="unix")]
while rdr.read_byte_record(&mut record)? {
let current_value = &record[column_index];

Expand All @@ -99,7 +100,6 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
return String::from_utf8(clean_piece.into_owned()).expect("encoding error");
}).collect();

#[cfg(target_family="unix")]
if !args.flag_unify {
let mut cmd = Command::new(prog)
.args(cmd_args)
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/jsonl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::config::{Config};
use crate::util;
use serde::Deserialize;

static USAGE: &'static str = "
static USAGE: &str = "
Converts a newline-delimited JSON file (.ndjson or .jsonl, typically) into
a CSV file.
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/lua.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use serde::Deserialize;

// TODO: options for boolean return coercion

static USAGE: &'static str = r#"
static USAGE: &str = r#"
Create a new column, filter rows or compute aggregations by executing a Lua
script of every line of a CSV file.
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/pseudo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::select::SelectColumns;
use crate::serde::Deserialize;
use crate::util;

static USAGE: &'static str = "
static USAGE: &str = "
Pseudonymise the value of the given column by replacing them by an
incremental identifier.
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class XSVRow(object):

// TODO: options for boolean return coercion

static USAGE: &'static str = r#"
static USAGE: &str = r#"
Create a new column, filter rows or compute aggregations by evaluating a python
expression on every row of a CSV file.
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/replace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::select::SelectColumns;
use crate::util;
use serde::Deserialize;

static USAGE: &'static str = "
static USAGE: &str = "
Replace occurrences of a pattern across a CSV file.
You can of course match groups using parentheses and use those in
Expand Down

0 comments on commit c044e4c

Please sign in to comment.