Merge rust-bitcoin/rust-bitcoin#1486: Fix typos in docs

4a6a12011d Fix typos in docs (Daniela Brozzoni)

Pull request description:

  See #828

ACKs for top commit:
  Kixunil:
    ACK 4a6a12011d
  apoelstra:
    ACK 4a6a12011d

Tree-SHA512: 3d3e2c37479986e51595a506c5310a37e51b9a84f9eb2f17c0217430e8150b7a9a7ee8b9c383df6c4ec581a081ea2a722ed4070ff4ede8d777d3bf2a2c19f15e
This commit is contained in:
Andrew Poelstra 2022-12-19 20:12:40 +00:00
commit eaee7c52dd
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
4 changed files with 9 additions and 9 deletions

View File

@ -458,7 +458,7 @@ fn fmt_satoshi_in(
/// Amount /// 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. /// arithmetic and conversion to various denominations.
/// ///
/// ///
@ -802,7 +802,7 @@ enum DisplayStyle {
/// SignedAmount /// 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. /// arithmetic and conversion to various denominations.
/// ///
/// ///

View File

@ -253,7 +253,7 @@ impl TxIn {
/// might increase more than `TxIn::segwit_weight`. This happens when: /// 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 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 /// - 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 { pub fn segwit_weight(&self) -> usize {
self.legacy_weight() + self.witness.serialized_len() self.legacy_weight() + self.witness.serialized_len()
} }

View File

@ -159,7 +159,7 @@ pub trait WriteExt : io::Write {
fn emit_u32(&mut self, v: u32) -> Result<(), io::Error>; fn emit_u32(&mut self, v: u32) -> Result<(), io::Error>;
/// Outputs a 16-bit unsigned integer. /// Outputs a 16-bit unsigned integer.
fn emit_u16(&mut self, v: u16) -> Result<(), io::Error>; 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>; fn emit_u8(&mut self, v: u8) -> Result<(), io::Error>;
/// Outputs a 64-bit signed integer. /// 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>; fn emit_i32(&mut self, v: i32) -> Result<(), io::Error>;
/// Outputs a 16-bit signed integer. /// Outputs a 16-bit signed integer.
fn emit_i16(&mut self, v: i16) -> Result<(), io::Error>; 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>; fn emit_i8(&mut self, v: i8) -> Result<(), io::Error>;
/// Outputs a boolean. /// Outputs a boolean.
@ -186,7 +186,7 @@ pub trait ReadExt : io::Read {
fn read_u32(&mut self) -> Result<u32, Error>; fn read_u32(&mut self) -> Result<u32, Error>;
/// Reads a 16-bit unsigned integer. /// Reads a 16-bit unsigned integer.
fn read_u16(&mut self) -> Result<u16, Error>; fn read_u16(&mut self) -> Result<u16, Error>;
/// Reads a 8-bit unsigned integer. /// Reads an 8-bit unsigned integer.
fn read_u8(&mut self) -> Result<u8, Error>; fn read_u8(&mut self) -> Result<u8, Error>;
/// Reads a 64-bit signed integer. /// Reads a 64-bit signed integer.
@ -195,7 +195,7 @@ pub trait ReadExt : io::Read {
fn read_i32(&mut self) -> Result<i32, Error>; fn read_i32(&mut self) -> Result<i32, Error>;
/// Reads a 16-bit signed integer. /// Reads a 16-bit signed integer.
fn read_i16(&mut self) -> Result<i16, Error>; fn read_i16(&mut self) -> Result<i16, Error>;
/// Reads a 8-bit signed integer. /// Reads an 8-bit signed integer.
fn read_i8(&mut self) -> Result<i8, Error>; fn read_i8(&mut self) -> Result<i8, Error>;
/// Reads a boolean. /// Reads a boolean.

View File

@ -38,14 +38,14 @@ pub const MAX_MSG_SIZE: usize = 5_000_000;
pub struct CommandString(Cow<'static, str>); pub struct CommandString(Cow<'static, str>);
impl CommandString { 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 /// This is more efficient for string literals than non-static conversions because it avoids
/// allocation. /// allocation.
/// ///
/// # Errors /// # 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. /// larger than 12 characters in length.
pub fn try_from_static(s: &'static str) -> Result<CommandString, CommandStringError> { pub fn try_from_static(s: &'static str) -> Result<CommandString, CommandStringError> {
Self::try_from_static_cow(s.into()) Self::try_from_static_cow(s.into())