From 4a6a12011d01b68664964596d2647ea6110cc025 Mon Sep 17 00:00:00 2001 From: Daniela Brozzoni Date: Mon, 19 Dec 2022 09:32:52 +0100 Subject: [PATCH] Fix typos in docs See #828 --- bitcoin/src/amount.rs | 4 ++-- bitcoin/src/blockdata/transaction.rs | 2 +- bitcoin/src/consensus/encode.rs | 8 ++++---- bitcoin/src/network/message.rs | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bitcoin/src/amount.rs b/bitcoin/src/amount.rs index b121dc9a..d1c50744 100644 --- a/bitcoin/src/amount.rs +++ b/bitcoin/src/amount.rs @@ -458,7 +458,7 @@ fn fmt_satoshi_in( /// Amount /// -/// The [Amount] type can be used to express Bitcoin amounts that supports +/// The [Amount] type can be used to express Bitcoin amounts that support /// arithmetic and conversion to various denominations. /// /// @@ -802,7 +802,7 @@ enum DisplayStyle { /// SignedAmount /// -/// The [SignedAmount] type can be used to express Bitcoin amounts that supports +/// The [SignedAmount] type can be used to express Bitcoin amounts that support /// arithmetic and conversion to various denominations. /// /// diff --git a/bitcoin/src/blockdata/transaction.rs b/bitcoin/src/blockdata/transaction.rs index a3023983..f41c2243 100644 --- a/bitcoin/src/blockdata/transaction.rs +++ b/bitcoin/src/blockdata/transaction.rs @@ -253,7 +253,7 @@ impl TxIn { /// might increase more than `TxIn::segwit_weight`. This happens when: /// - the new input added causes the input length `VarInt` to increase its encoding length /// - the new input is the first segwit input added - this will add an additional 2WU to the - /// transaction weight to take into account the segwit marker + /// transaction weight to take into account the segwit marker pub fn segwit_weight(&self) -> usize { self.legacy_weight() + self.witness.serialized_len() } diff --git a/bitcoin/src/consensus/encode.rs b/bitcoin/src/consensus/encode.rs index ef3d7344..1d2311a4 100644 --- a/bitcoin/src/consensus/encode.rs +++ b/bitcoin/src/consensus/encode.rs @@ -159,7 +159,7 @@ pub trait WriteExt : io::Write { fn emit_u32(&mut self, v: u32) -> Result<(), io::Error>; /// Outputs a 16-bit unsigned integer. fn emit_u16(&mut self, v: u16) -> Result<(), io::Error>; - /// Outputs a 8-bit unsigned integer. + /// Outputs an 8-bit unsigned integer. fn emit_u8(&mut self, v: u8) -> Result<(), io::Error>; /// Outputs a 64-bit signed integer. @@ -168,7 +168,7 @@ pub trait WriteExt : io::Write { fn emit_i32(&mut self, v: i32) -> Result<(), io::Error>; /// Outputs a 16-bit signed integer. fn emit_i16(&mut self, v: i16) -> Result<(), io::Error>; - /// Outputs a 8-bit signed integer. + /// Outputs an 8-bit signed integer. fn emit_i8(&mut self, v: i8) -> Result<(), io::Error>; /// Outputs a boolean. @@ -186,7 +186,7 @@ pub trait ReadExt : io::Read { fn read_u32(&mut self) -> Result; /// Reads a 16-bit unsigned integer. fn read_u16(&mut self) -> Result; - /// Reads a 8-bit unsigned integer. + /// Reads an 8-bit unsigned integer. fn read_u8(&mut self) -> Result; /// Reads a 64-bit signed integer. @@ -195,7 +195,7 @@ pub trait ReadExt : io::Read { fn read_i32(&mut self) -> Result; /// Reads a 16-bit signed integer. fn read_i16(&mut self) -> Result; - /// Reads a 8-bit signed integer. + /// Reads an 8-bit signed integer. fn read_i8(&mut self) -> Result; /// Reads a boolean. diff --git a/bitcoin/src/network/message.rs b/bitcoin/src/network/message.rs index 1f533fa6..40ab55c2 100644 --- a/bitcoin/src/network/message.rs +++ b/bitcoin/src/network/message.rs @@ -38,14 +38,14 @@ pub const MAX_MSG_SIZE: usize = 5_000_000; pub struct CommandString(Cow<'static, str>); impl CommandString { - /// Convert `&'static str` to `CommandString` + /// Converts `&'static str` to `CommandString` /// /// This is more efficient for string literals than non-static conversions because it avoids /// allocation. /// /// # Errors /// - /// Returns an error if and only if the string is + /// Returns an error if, and only if, the string is /// larger than 12 characters in length. pub fn try_from_static(s: &'static str) -> Result { Self::try_from_static_cow(s.into())