Skip to content

Commit

Permalink
correct the variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
magiclen committed Nov 26, 2023
1 parent cf841ce commit 2a9883a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/bit/adjusted/built_in_traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use super::{AdjustedBit, Bit, Unit, UnitType};
use crate::ParseError;

impl From<Bit> for AdjustedBit {
/// `multiple_option` is set to `UnitType::Both`. See [`Bit::get_appropriate_unit`](./struct.Bit.html#method.get_appropriate_unit).
/// `unit_type` is set to `UnitType::Both`. See [`Bit::get_appropriate_unit`](./struct.Bit.html#method.get_appropriate_unit).
#[inline]
fn from(value: Bit) -> Self {
value.get_appropriate_unit(UnitType::Both)
Expand Down Expand Up @@ -35,7 +35,7 @@ impl From<AdjustedBit> for Bit {
impl FromStr for AdjustedBit {
type Err = ParseError;

/// * `multiple_option` is set to `UnitType::Both`. See [`Bit::get_appropriate_unit`](./struct.Bit.html#method.get_appropriate_unit).
/// * `unit_type` is set to `UnitType::Both`. See [`Bit::get_appropriate_unit`](./struct.Bit.html#method.get_appropriate_unit).
#[inline]
fn from_str(s: &str) -> Result<Self, Self::Err> {
Ok(Bit::parse_str(s)?.get_appropriate_unit(UnitType::Both))
Expand Down
4 changes: 2 additions & 2 deletions src/bit/adjusted/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,10 @@ impl Bit {
///
/// assert_eq!("48.48480224609375 Mib", adjusted_bit.to_string());
/// ```
pub fn get_appropriate_unit(&self, multiple_option: UnitType) -> AdjustedBit {
pub fn get_appropriate_unit(&self, unit_type: UnitType) -> AdjustedBit {
let a = Unit::get_multiples_bits();

let (skip, step) = match multiple_option {
let (skip, step) = match unit_type {
UnitType::Binary => (0, 2),
UnitType::Decimal => (1, 2),
UnitType::Both => (0, 1),
Expand Down
4 changes: 2 additions & 2 deletions src/byte/adjusted/built_in_traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use super::{AdjustedByte, Byte, Unit, UnitType};
use crate::ParseError;

impl From<Byte> for AdjustedByte {
/// `multiple_option` is set to `UnitType::Both`. See [`Byte::get_appropriate_unit`](./struct.Byte.html#method.get_appropriate_unit).
/// `unit_type` is set to `UnitType::Both`. See [`Byte::get_appropriate_unit`](./struct.Byte.html#method.get_appropriate_unit).
#[inline]
fn from(value: Byte) -> Self {
value.get_appropriate_unit(UnitType::Both)
Expand Down Expand Up @@ -36,7 +36,7 @@ impl FromStr for AdjustedByte {
type Err = ParseError;

/// * `ignore_case` is set to `false`. See [`Byte::parse_str`](./struct.Byte.html#method.parse_str).
/// * `multiple_option` is set to `UnitType::Both`. See [`Byte::get_appropriate_unit`](./struct.Byte.html#method.get_appropriate_unit).
/// * `unit_type` is set to `UnitType::Both`. See [`Byte::get_appropriate_unit`](./struct.Byte.html#method.get_appropriate_unit).
#[inline]
fn from_str(s: &str) -> Result<Self, Self::Err> {
Ok(Byte::parse_str(s, false)?.get_appropriate_unit(UnitType::Both))
Expand Down
4 changes: 2 additions & 2 deletions src/byte/adjusted/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,10 @@ impl Byte {
///
/// assert_eq!("48.48480224609375 MiB", adjusted_byte.to_string());
/// ```
pub fn get_appropriate_unit(&self, multiple_option: UnitType) -> AdjustedByte {
pub fn get_appropriate_unit(&self, unit_type: UnitType) -> AdjustedByte {
let a = Unit::get_multiples_bytes();

let (skip, step) = match multiple_option {
let (skip, step) = match unit_type {
UnitType::Binary => (0, 2),
UnitType::Decimal => (1, 2),
UnitType::Both => (0, 1),
Expand Down

0 comments on commit 2a9883a

Please sign in to comment.