Skip to content

Commit 87d386c

Browse files
committed
[ISSUE #309]✨Add rocketmq-cmd crate
1 parent 0613bae commit 87d386c

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
members = [
33
"rocketmq",
44
"rocketmq-broker",
5+
"rocketmq-cmd",
56
"rocketmq-common",
67
"rocketmq-filter",
78
"rocketmq-macros",

rocketmq-cmd/Cargo.toml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[package]
2+
name = "rocketmq-cmd"
3+
version.workspace = true
4+
authors.workspace = true
5+
edition.workspace = true
6+
homepage.workspace = true
7+
repository.workspace = true
8+
license.workspace = true
9+
keywords.workspace = true
10+
readme.workspace = true
11+
description.workspace = true
12+
13+
[dependencies]

rocketmq-cmd/src/lib.rs

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
pub fn add(left: usize, right: usize) -> usize {
19+
left + right
20+
}
21+
22+
#[cfg(test)]
23+
mod tests {
24+
use super::*;
25+
26+
#[test]
27+
fn it_works() {
28+
let result = add(2, 2);
29+
assert_eq!(result, 4);
30+
}
31+
}

0 commit comments

Comments
 (0)