@@ -64,9 +64,13 @@ struct Args {
64
64
#[ argh( option) ]
65
65
version : String ,
66
66
67
- /// version of the bson crate
67
+ /// version of the bson crate (2.x)
68
68
#[ argh( option) ]
69
- bson : Option < String > ,
69
+ bson2 : Option < String > ,
70
+
71
+ /// version of the bson crate (3.x)
72
+ #[ argh( option) ]
73
+ bson3 : Option < String > ,
70
74
71
75
/// version of the mongocrypt crate
72
76
#[ argh( option) ]
@@ -110,16 +114,26 @@ fn main() {
110
114
pending. apply ( loc, & args. version ) ;
111
115
}
112
116
113
- if let Some ( bson) = args. bson {
114
- let bson_version_loc =
115
- Location :: new ( "Cargo.toml" , r#"bson =.*version = "(?<target>.*?)".*"# ) ;
116
- pending. apply ( & bson_version_loc, & bson) ;
117
+ if let Some ( bson2) = args. bson2 {
118
+ let bson_version_loc = Location :: new (
119
+ "Cargo.toml" ,
120
+ r#"\[dependencies.bson2\]\nversion = "(?<target>.*?)"\n"# ,
121
+ ) ;
122
+ pending. apply ( & bson_version_loc, & bson2) ;
123
+ }
124
+
125
+ if let Some ( bson3) = args. bson3 {
126
+ let bson_version_loc = Location :: new (
127
+ "Cargo.toml" ,
128
+ r#"\[dependencies.bson3\]\nversion = "(?<target>.*?)"\n"# ,
129
+ ) ;
130
+ pending. apply ( & bson_version_loc, & bson3) ;
117
131
}
118
132
119
133
if let Some ( mongocrypt) = args. mongocrypt {
120
134
let mongocrypt_version_loc = Location :: new (
121
135
"Cargo.toml" ,
122
- r#"mongocrypt =.*version = "(?<target>.*?)".*"# ,
136
+ r#"\[dependencies.mongocrypt\]\nversion = "(?<target>.*?)".*"# ,
123
137
) ;
124
138
pending. apply ( & mongocrypt_version_loc, & mongocrypt) ;
125
139
}
0 commit comments