Skip to content

Commit 9a62523

Browse files
authored
bump Cargo.toml to 1.0.0-rc1 (#1728)
* bump to 1.0.0-rc1 * add suffix to commit version processing
1 parent 0d522da commit 9a62523

File tree

3 files changed

+35
-18
lines changed

3 files changed

+35
-18
lines changed

Cargo.lock

+14-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ resolver = "2"
2424

2525
[workspace.package]
2626
license = "MIT"
27-
version = "0.1.0"
27+
version = "1.0.0-rc1"
2828

2929
[workspace.dependencies]
3030
anyhow = "1.0"

xmtp_mls/src/groups/validated_commit.rs

+20-3
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ pub enum CommitValidationError {
9393
StorageError(#[from] StorageError),
9494
#[error("Exceeded max characters for this field. Must be under: {length}")]
9595
TooManyCharacters { length: usize },
96+
#[error("Version part missing")]
97+
VersionMissing,
9698
}
9799

98100
impl RetryableError for CommitValidationError {
@@ -224,6 +226,7 @@ pub struct LibXMTPVersion {
224226
major: u32,
225227
minor: u32,
226228
patch: u32,
229+
suffix: Option<String>,
227230
}
228231

229232
impl LibXMTPVersion {
@@ -235,20 +238,34 @@ impl LibXMTPVersion {
235238
));
236239
}
237240

238-
let major = parts[0]
241+
let major = parts
242+
.first()
243+
.ok_or(CommitValidationError::VersionMissing)?
239244
.parse()
240245
.map_err(|_| CommitValidationError::InvalidVersionFormat(version_str.to_string()))?;
241-
let minor = parts[1]
246+
let minor = parts
247+
.get(1)
248+
.ok_or(CommitValidationError::VersionMissing)?
242249
.parse()
243250
.map_err(|_| CommitValidationError::InvalidVersionFormat(version_str.to_string()))?;
244-
let patch = parts[2]
251+
252+
let patch_and_suffix = parts
253+
.get(2)
254+
.ok_or(CommitValidationError::VersionMissing)?
255+
.split('-')
256+
.collect::<Vec<_>>();
257+
258+
let patch = patch_and_suffix
259+
.first()
260+
.ok_or(CommitValidationError::VersionMissing)?
245261
.parse()
246262
.map_err(|_| CommitValidationError::InvalidVersionFormat(version_str.to_string()))?;
247263

248264
Ok(LibXMTPVersion {
249265
major,
250266
minor,
251267
patch,
268+
suffix: patch_and_suffix.get(1).map(ToString::to_string),
252269
})
253270
}
254271
}

0 commit comments

Comments
 (0)