mirror of
https://github.com/Orange-OpenSource/hurl.git
synced 2024-11-28 12:53:01 +03:00
Merge pull request #113 from Orange-OpenSource/features/update-rust-1.49.0
Update rust 1.49.0
This commit is contained in:
commit
d2316401ba
@ -2,7 +2,7 @@
|
||||
set -e
|
||||
|
||||
# Check version
|
||||
EXPECTED="1.48.0"
|
||||
EXPECTED="1.49.0"
|
||||
ACTUAL="$(cargo --version | cut -d" " -f2)"
|
||||
echo "check that version is $EXPECTED"
|
||||
if [ "$EXPECTED" != "$ACTUAL" ]; then
|
||||
|
@ -453,7 +453,7 @@ impl Client {
|
||||
}
|
||||
|
||||
let response_code = self.handle.response_code().unwrap();
|
||||
if response_code < 300 || response_code >= 400 {
|
||||
if !(300..400).contains(&response_code) {
|
||||
return None;
|
||||
}
|
||||
|
||||
|
@ -74,7 +74,7 @@ fn execute(
|
||||
.split(&contents)
|
||||
.map(|l| l.to_string())
|
||||
.collect();
|
||||
let optional_filename = if filename == "" {
|
||||
let optional_filename = if filename.is_empty() {
|
||||
None
|
||||
} else {
|
||||
Some(filename.to_string())
|
||||
|
@ -40,7 +40,7 @@ pub fn parse(reader: &mut Reader) -> Vec<u8> {
|
||||
let mut buf = vec![]; // base64 text
|
||||
loop {
|
||||
let pad = padding(reader);
|
||||
if pad != "" {
|
||||
if !pad.is_empty() {
|
||||
break;
|
||||
}
|
||||
let save = reader.state.clone();
|
||||
|
@ -59,7 +59,7 @@ pub fn parse2(reader: &mut Reader) -> ParseResult<'static, Expr> {
|
||||
fn variable_name(reader: &mut Reader) -> ParseResult<'static, Variable> {
|
||||
let start = reader.state.clone();
|
||||
let name = reader.read_while(|c| c.is_alphanumeric() || *c == '_');
|
||||
if name == "" {
|
||||
if name.is_empty() {
|
||||
return Err(Error {
|
||||
pos: start.pos,
|
||||
recoverable: false,
|
||||
|
@ -760,7 +760,7 @@ impl Tokenizable for LineTerminator {
|
||||
impl Tokenizable for Whitespace {
|
||||
fn tokenize(&self) -> Vec<Token> {
|
||||
let mut tokens: Vec<Token> = vec![];
|
||||
if self.value != "" {
|
||||
if !self.value.is_empty() {
|
||||
tokens.push(Token::Whitespace(self.clone().value));
|
||||
}
|
||||
tokens
|
||||
|
@ -685,7 +685,7 @@ impl Lintable<LineTerminator> for LineTerminator {
|
||||
}
|
||||
}
|
||||
None => {
|
||||
if self.space0.value != "" {
|
||||
if !self.space0.value.is_empty() {
|
||||
errors.push(Error {
|
||||
source_info: self.clone().space0.source_info,
|
||||
inner: LinterError::UnneccessarySpace {},
|
||||
@ -709,7 +709,7 @@ impl Lintable<LineTerminator> for LineTerminator {
|
||||
Some(comment) => Some(comment.lint()),
|
||||
};
|
||||
let newline = Whitespace {
|
||||
value: if self.newline.value == "" {
|
||||
value: if self.newline.value.is_empty() {
|
||||
"".to_string()
|
||||
} else {
|
||||
"\n".to_string()
|
||||
|
@ -158,7 +158,7 @@ fn main() {
|
||||
.collect();
|
||||
|
||||
let lines: Vec<String> = lines.iter().map(|s| (*s).to_string()).collect();
|
||||
let optional_filename = if filename == "" {
|
||||
let optional_filename = if filename.is_empty() {
|
||||
None
|
||||
} else {
|
||||
Some(filename.to_string())
|
||||
|
Loading…
Reference in New Issue
Block a user