Skip to content

Commit

Permalink
refact: avoid using multiple copies of the PrivOwnedStr struct
Browse files Browse the repository at this point in the history
  • Loading branch information
BillCarsonFr committed Dec 3, 2024
1 parent 1f50e4b commit 2151fcd
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions crates/matrix-sdk/src/authentication/qrcode/messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// limitations under the License.

use matrix_sdk_base::crypto::types::SecretsBundle;
use matrix_sdk_common::deserialized_responses::PrivOwnedStr;
use openidconnect::{
core::CoreDeviceAuthorizationResponse, EndUserVerificationUrl, VerificationUriComplete,
};
Expand Down Expand Up @@ -183,15 +184,6 @@ where
s.serialize_str(&key.to_base64())
}

// Wrapper around `Box<str>` that cannot be used in a meaningful way outside of
// this crate. Used for string enums because their `_Custom` variant can't be
// truly private (only `#[doc(hidden)]`).
// TODO: It probably makes sense to move the above messages into Ruma, if for
// nothing else, to get rid of this `PrivOwnedStr`.
#[doc(hidden)]
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct PrivOwnedStr(Box<str>);

#[cfg(test)]
mod test {
use assert_matches2::assert_let;
Expand Down

0 comments on commit 2151fcd

Please sign in to comment.