Browse Source

Fix lints

pull/137/head
Andrea Ciliberti 1 year ago
parent
commit
fdd836ba9d
  1. 2
      ctru-rs/examples/buttons.rs
  2. 2
      ctru-rs/examples/camera-image.rs
  3. 6
      ctru-rs/examples/movement.rs

2
ctru-rs/examples/buttons.rs

@ -28,7 +28,7 @@ fn main() {
// Print the status of the volume slider. // Print the status of the volume slider.
println!( println!(
"\x1b[20;0HVolume slider: {} ", "\x1b[20;0HVolume slider: {} ",
hid.slider_volume() hid.volume_slider()
); );
// We only want to print when the keys we're holding now are different // We only want to print when the keys we're holding now are different

2
ctru-rs/examples/camera-image.rs

@ -76,7 +76,7 @@ fn main() {
if keys_down.contains(KeyPad::R) { if keys_down.contains(KeyPad::R) {
println!("Capturing new image"); println!("Capturing new image");
let mut camera = &mut cam.both_outer_cams; let camera = &mut cam.both_outer_cams;
// Take a picture and write it to the buffer. // Take a picture and write it to the buffer.
camera camera

6
ctru-rs/examples/movement.rs

@ -19,8 +19,8 @@ fn main() {
// Activate the accelerometer and the gyroscope. // Activate the accelerometer and the gyroscope.
// Because of the complex nature of the movement sensors, they aren't activated by default with the `Hid` service. // Because of the complex nature of the movement sensors, they aren't activated by default with the `Hid` service.
// However, they can simply be turned on and off whenever necessary. // However, they can simply be turned on and off whenever necessary.
hid.enable_accelerometer(); hid.set_accelerometer(true);
hid.enable_gyroscope(); hid.set_gyroscope(true);
while apt.main_loop() { while apt.main_loop() {
// Scan all the controller inputs. // Scan all the controller inputs.
@ -35,10 +35,12 @@ fn main() {
println!( println!(
"\x1b[3;0HAcceleration: {:?} ", "\x1b[3;0HAcceleration: {:?} ",
hid.accelerometer_vector() hid.accelerometer_vector()
.expect("could not retrieve acceleration vector")
); );
println!( println!(
"\x1b[4;0HGyroscope angular rate: {:?} ", "\x1b[4;0HGyroscope angular rate: {:?} ",
hid.gyroscope_rate() hid.gyroscope_rate()
.expect("could not retrieve angular rate")
); );
gfx.wait_for_vblank(); gfx.wait_for_vblank();

Loading…
Cancel
Save