mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-18 10:35:25 +00:00
Fix clippy warnings
This commit is contained in:
parent
23993c2833
commit
8adb8b5105
1 changed files with 2 additions and 4 deletions
|
@ -1083,9 +1083,7 @@ impl<O: OutputStream> Compiler<O> {
|
||||||
// Doc string value:
|
// Doc string value:
|
||||||
self.emit(Instruction::LoadConst {
|
self.emit(Instruction::LoadConst {
|
||||||
value: match doc_str {
|
value: match doc_str {
|
||||||
Some(doc) => bytecode::Constant::String {
|
Some(doc) => bytecode::Constant::String { value: doc },
|
||||||
value: doc.to_string(),
|
|
||||||
},
|
|
||||||
None => bytecode::Constant::None, // set docstring None if not declared
|
None => bytecode::Constant::None, // set docstring None if not declared
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -2199,7 +2197,7 @@ fn get_doc(body: &[ast::Statement]) -> (&[ast::Statement], Option<String>) {
|
||||||
if let ast::StatementType::Expression { ref expression } = val.node {
|
if let ast::StatementType::Expression { ref expression } = val.node {
|
||||||
if let ast::ExpressionType::String { value } = &expression.node {
|
if let ast::ExpressionType::String { value } = &expression.node {
|
||||||
if let Some(value) = try_get_constant_string(value) {
|
if let Some(value) = try_get_constant_string(value) {
|
||||||
return (body_rest, Some(value.to_string()));
|
return (body_rest, Some(value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue