Use the Self keyword where applicable.
https://github.com/rust-lang-nursery/rust-clippy/wiki#use_self
This commit is contained in:
@@ -144,8 +144,8 @@ pub struct FunctionImports {
|
||||
}
|
||||
|
||||
impl FunctionImports {
|
||||
fn new() -> FunctionImports {
|
||||
FunctionImports {
|
||||
fn new() -> Self {
|
||||
Self {
|
||||
functions: HashMap::new(),
|
||||
signatures: HashMap::new(),
|
||||
}
|
||||
|
||||
@@ -46,8 +46,8 @@ pub struct ImportMappings {
|
||||
|
||||
impl ImportMappings {
|
||||
/// Create a new empty `ImportMappings`.
|
||||
pub fn new() -> ImportMappings {
|
||||
ImportMappings {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
functions: HashMap::new(),
|
||||
signatures: HashMap::new(),
|
||||
}
|
||||
|
||||
@@ -15,8 +15,8 @@ pub struct DummyRuntime {
|
||||
|
||||
impl DummyRuntime {
|
||||
/// Allocates the runtime data structures.
|
||||
pub fn new() -> DummyRuntime {
|
||||
DummyRuntime { globals: Vec::new() }
|
||||
pub fn new() -> Self {
|
||||
Self { globals: Vec::new() }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ impl cretonne::entity::EntityRef for Local {
|
||||
}
|
||||
}
|
||||
impl Default for Local {
|
||||
fn default() -> Local {
|
||||
fn default() -> Self {
|
||||
Local(u32::MAX)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user