Skip to content

Commit 91b9ef1

Browse files
authored
Merge pull request #24 from cospectrum/bit-doc
Edit doc for Bit
2 parents e4e4447 + 59a923b commit 91b9ef1

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,12 @@ Usage of the `Bit` struct and the `Byte` struct is very similar. Also, There is
139139
```rust
140140
use byte_unit::{Bit, Unit};
141141

142-
let byte = Bit::parse_str("123Kib").unwrap();
142+
let bit = Bit::parse_str("123Kib").unwrap();
143143

144-
let adjusted_byte = byte.get_adjusted_unit(Unit::Kbit);
144+
let adjusted_bit = bit.get_adjusted_unit(Unit::Kbit);
145145

146-
assert_eq!("125.952 Kb", adjusted_byte.to_string());
147-
assert_eq!("125.95 Kb", format!("{adjusted_byte:.2}"));
146+
assert_eq!("125.952 Kb", adjusted_bit.to_string());
147+
assert_eq!("125.95 Kb", format!("{adjusted_bit:.2}"));
148148
```
149149

150150
## No Std
@@ -188,4 +188,4 @@ https://docs.rs/byte-unit
188188

189189
## License
190190

191-
[MIT](LICENSE)
191+
[MIT](LICENSE)

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,12 @@ Usage of the `Bit` struct and the `Byte` struct is very similar. Also, There is
160160
# {
161161
use byte_unit::{Bit, Unit};
162162
163-
let byte = Bit::parse_str("123Kib").unwrap();
163+
let bit = Bit::parse_str("123Kib").unwrap();
164164
165-
let adjusted_byte = byte.get_adjusted_unit(Unit::Kbit);
165+
let adjusted_bit = bit.get_adjusted_unit(Unit::Kbit);
166166
167-
assert_eq!("125.952 Kb", adjusted_byte.to_string());
168-
assert_eq!("125.95 Kb", format!("{adjusted_byte:.2}"));
167+
assert_eq!("125.952 Kb", adjusted_bit.to_string());
168+
assert_eq!("125.95 Kb", format!("{adjusted_bit:.2}"));
169169
# }
170170
```
171171

0 commit comments

Comments
 (0)