Merge pull request #113 from Orange-OpenSource/features/update-rust-1.49.0

Update rust 1.49.0
This commit is contained in:
Fabrice Reix 2021-01-05 08:25:17 +01:00 committed by GitHub
commit d2316401ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 9 additions and 9 deletions

View File

@ -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

View File

@ -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;
}

View File

@ -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())

View File

@ -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();

View File

@ -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,

View File

@ -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

View File

@ -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()

View File

@ -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())