Skip to content

Commit

Permalink
feat: remove redundant imports
Browse files Browse the repository at this point in the history
  • Loading branch information
houseme committed Mar 3, 2024
1 parent 6f193d8 commit 672b08d
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "qrcode-rs"
description = "QR code encoder in Rust,Generate QR Code matrices and images in RAW, PNG and SVG formats."
license = "MIT OR Apache-2.0"
version = "0.1.2"
version = "0.1.3"
edition = "2021"
authors = ["houseme <[email protected]>"]
repository = "https://github.com/houseme/qrcode-rs"
Expand Down
10 changes: 5 additions & 5 deletions src/bits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl Bits {
/// Pushes an N-bit big-endian integer to the end of the bits.
///
/// Note: It is up to the developer to ensure that `number` really only is
/// `n` bit in size. Otherwise the excess bits may stomp on the existing
/// `n` bit in size. Otherwise, the excess bits may stomp on the existing
/// ones.
fn push_number(&mut self, n: usize, number: u16) {
debug_assert!(n == 16 || n < 16 && number < (1 << n), "{number} is too big as a {n}-bit number");
Expand Down Expand Up @@ -79,7 +79,7 @@ impl Bits {
self.data.reserve(extra_bytes);
}

/// Convert the bits into a bytes vector.
/// Convert the bits into a byte vector.
pub fn into_bytes(self) -> Vec<u8> {
self.data
}
Expand Down Expand Up @@ -253,7 +253,7 @@ impl Bits {
/// If the QR code version does not support ECI, this method will return
/// `Err(QrError::UnsupportedCharacterSet)`.
///
/// If the designator is outside of the expected range, this method will
/// If the designator is outside the expected range, this method will
/// return `Err(QrError::InvalidECIDesignator)`.
pub fn push_eci_designator(&mut self, eci_designator: u32) -> QrResult<()> {
self.reserve(12); // assume the common case that eci_designator <= 127.
Expand Down Expand Up @@ -426,7 +426,7 @@ fn alphanumeric_digit(character: u8) -> u16 {
impl Bits {
/// Encodes an alphanumeric string to the bits.
///
/// The data should only contain the charaters A to Z (excluding lowercase),
/// The data should only contain the characters A to Z (excluding lowercase),
/// 0 to 9, space, `$`, `%`, `*`, `+`, `-`, `.`, `/` or `:`.
///
/// # Errors
Expand Down Expand Up @@ -809,7 +809,7 @@ impl Bits {
/// Returns `Err(QrError::DataTooLong)` on overflow.
///
/// Returns `Err(QrError::InvalidData)` if the segment refers to incorrectly
/// encoded byte sequence.
/// encoded byte sequences.
pub fn push_segments<I>(&mut self, data: &[u8], segments_iter: I) -> QrResult<()>
where
I: Iterator<Item = Segment>,
Expand Down
1 change: 0 additions & 1 deletion src/cast.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::fmt::Display;

#[cfg(debug_assertions)]
use std::convert::TryInto;

pub trait Truncate {
fn truncate_as_u8(self) -> u8;
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ clippy::must_use_candidate, // This is just annoying.
#![cfg_attr(feature = "bench", doc = include_str!("../README.md"))]
// ^ make sure we can test our README.md.

use std::convert::TryInto;
use std::ops::Index;

pub mod bits;
Expand Down
1 change: 0 additions & 1 deletion src/types.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::cast::As;
use std::cmp::{Ordering, PartialOrd};
use std::default::Default;
use std::fmt::{Display, Error, Formatter};
use std::ops::Not;

Expand Down

0 comments on commit 672b08d

Please sign in to comment.