Skip to content

Commit

Permalink
refactor: rename get_volume method to volume in MicDevice
Browse files Browse the repository at this point in the history
  • Loading branch information
amiyzku committed Oct 25, 2023
1 parent e985fb4 commit a543314
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fn main() -> Result<()> {
}

let mic = MicDevice::new(device_id.unwrap());
let vol = mic.get_volume();
let vol = mic.volume();
if vol.is_err() {
eprintln!("Failed to get mic volume");
std::thread::sleep(std::time::Duration::from_secs(3));
Expand Down
4 changes: 2 additions & 2 deletions src/mic_device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ impl MicDevice {
Self { device_id }
}

pub fn get_volume(&self) -> Result<Volume> {
pub fn volume(&self) -> Result<Volume> {
let volume: f32 = 0.0;
let data_size = mem::size_of::<UInt32>();

Expand Down Expand Up @@ -83,7 +83,7 @@ mod tests {
sut.set_volume(&expected).expect("Failed to set mic volume");

// Act
let vol = sut.get_volume().expect("Failed to get mic volume");
let vol = sut.volume().expect("Failed to get mic volume");

// Assert
assert_eq!(vol, expected);
Expand Down

0 comments on commit a543314

Please sign in to comment.