Merge pull request #3185 from tnull/2024-07-clarify-max-description-length

Clarify maximum length of an invoice description
This commit is contained in:
Matt Corallo 2024-07-16 08:24:45 -07:00 committed by GitHub
commit dee3ba7d6a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1510,8 +1510,8 @@ impl TaggedField {
impl Description {
/// Creates a new `Description` if `description` is at most 1023 __bytes__ long,
/// returns [`CreationError::DescriptionTooLong`] otherwise
/// Creates a new `Description` if `description` is at most 1023 * 5 bits (i.e., 639 bytes)
/// long, and returns [`CreationError::DescriptionTooLong`] otherwise.
///
/// Please note that single characters may use more than one byte due to UTF8 encoding.
pub fn new(description: String) -> Result<Description, CreationError> {