Consistently use Self as return type
This commit is contained in:
parent
e51bd4a8e2
commit
9fce6f97dc
|
@ -9,7 +9,7 @@ pub struct Screen {
|
|||
}
|
||||
|
||||
impl Screen {
|
||||
pub fn new() -> Screen {
|
||||
pub fn new() -> Self {
|
||||
Screen {
|
||||
pixels: [[false; WIDTH]; HEIGHT],
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ pub struct Chip8 {
|
|||
}
|
||||
|
||||
impl Chip8 {
|
||||
pub fn new(audio_subsystem: &AudioSubsystem) -> Chip8 {
|
||||
pub fn new(audio_subsystem: &AudioSubsystem) -> Self {
|
||||
Chip8 {
|
||||
memory: Memory::new(),
|
||||
registers: Registers::new(),
|
||||
|
|
|
@ -7,7 +7,7 @@ pub struct Keyboard {
|
|||
}
|
||||
|
||||
impl Keyboard {
|
||||
pub fn new() -> Keyboard {
|
||||
pub fn new() -> Self {
|
||||
Keyboard {
|
||||
keyboard: [false; KEYS],
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ fn copy_default_char_set(memory: &mut Memory) {
|
|||
}
|
||||
|
||||
impl Memory {
|
||||
pub fn new() -> Memory {
|
||||
pub fn new() -> Self {
|
||||
let mut memory = Memory {
|
||||
memory: [0; MEMORY_SIZE],
|
||||
};
|
||||
|
|
|
@ -60,7 +60,7 @@ pub struct Registers {
|
|||
}
|
||||
|
||||
impl Registers {
|
||||
pub fn new() -> Registers {
|
||||
pub fn new() -> Self {
|
||||
Registers {
|
||||
data: [0; DATA_REGISTERS],
|
||||
i: 0,
|
||||
|
|
|
@ -5,7 +5,7 @@ pub struct Stack {
|
|||
}
|
||||
|
||||
impl Stack {
|
||||
pub fn new() -> Stack {
|
||||
pub fn new() -> Self {
|
||||
Stack {
|
||||
stack: [0; STACK_DEPTH],
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue