Skip to content

Commit e3e085d

Browse files
Troels51kedars
authored andcommitted
Spelling: Sucess => Success
1 parent 9b5a253 commit e3e085d

File tree

11 files changed

+33
-33
lines changed

11 files changed

+33
-33
lines changed

matter/src/data_model/cluster_on_off.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ impl ClusterType for OnOffCluster {
9090
.map_err(|_| IMStatusCode::Failure)?;
9191
}
9292
cmd_req.trans.complete();
93-
Err(IMStatusCode::Sucess)
93+
Err(IMStatusCode::Success)
9494
}
9595
Commands::On => {
9696
cmd_enter!("On");
@@ -105,7 +105,7 @@ impl ClusterType for OnOffCluster {
105105
}
106106

107107
cmd_req.trans.complete();
108-
Err(IMStatusCode::Sucess)
108+
Err(IMStatusCode::Success)
109109
}
110110
Commands::Toggle => {
111111
cmd_enter!("Toggle");
@@ -121,7 +121,7 @@ impl ClusterType for OnOffCluster {
121121
.write_attribute_raw(Attributes::OnOff as u16, AttrValue::Bool(!value))
122122
.map_err(|_| IMStatusCode::Failure)?;
123123
cmd_req.trans.complete();
124-
Err(IMStatusCode::Sucess)
124+
Err(IMStatusCode::Success)
125125
}
126126
}
127127
}

matter/src/data_model/core/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ impl DataModel {
135135
encoder.set_path(*path);
136136
let mut access_req = AccessReq::new(accessor, path, Access::WRITE);
137137
let r = match Cluster::write_attribute(c, &mut access_req, write_data, &attr) {
138-
Ok(_) => IMStatusCode::Sucess,
138+
Ok(_) => IMStatusCode::Success,
139139
Err(e) => e,
140140
};
141141
encoder.encode_status(r, 0);
@@ -384,7 +384,7 @@ impl<'a, 'b, 'c> Encoder for AttrWriteEncoder<'a, 'b, 'c> {
384384
}
385385

386386
fn encode_status(&mut self, status: IMStatusCode, cluster_status: u16) {
387-
if self.skip_error && status != IMStatusCode::Sucess {
387+
if self.skip_error && status != IMStatusCode::Success {
388388
// Don't encode errors
389389
return;
390390
}

matter/src/data_model/objects/cluster.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ impl Cluster {
207207
encoder: &mut dyn Encoder,
208208
attr: &AttrDetails,
209209
) {
210-
let mut error = IMStatusCode::Sucess;
210+
let mut error = IMStatusCode::Success;
211211
let base = c.base();
212212
let a = if let Ok(a) = base.get_attribute(attr.attr_id) {
213213
a
@@ -225,7 +225,7 @@ impl Cluster {
225225
error = IMStatusCode::UnsupportedAccess;
226226
}
227227

228-
if error != IMStatusCode::Sucess {
228+
if error != IMStatusCode::Success {
229229
encoder.encode_status(error, 0);
230230
} else if Attribute::is_system_attr(attr.attr_id) {
231231
c.base().read_system_attribute(encoder, a)

matter/src/data_model/sdm/admin_commissioning.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ impl AdminCommCluster {
145145
let verifier = VerifierData::new(req.verifier.0, req.iterations, req.salt.0);
146146
self.pase_mgr
147147
.enable_pase_session(verifier, req.discriminator)?;
148-
Err(IMStatusCode::Sucess)
148+
Err(IMStatusCode::Success)
149149
}
150150
}
151151

matter/src/data_model/sdm/noc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ impl NocCluster {
410410
}
411411
cmd_req.trans.complete();
412412

413-
Err(IMStatusCode::Sucess)
413+
Err(IMStatusCode::Success)
414414
}
415415
}
416416

matter/src/interaction_model/core.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ impl InteractionModel {
139139
trans.set_timeout(req.timeout.into());
140140

141141
let status = StatusResp {
142-
status: IMStatusCode::Sucess,
142+
status: IMStatusCode::Success,
143143
};
144144
let mut tw = TLVWriter::new(proto_tx.get_writebuf()?);
145145
let _ = status.to_tlv(&mut tw, TagType::Anonymous);
@@ -213,7 +213,7 @@ impl proto_demux::HandleProto for InteractionModel {
213213

214214
#[derive(FromPrimitive, Debug, Clone, Copy, PartialEq)]
215215
pub enum IMStatusCode {
216-
Sucess = 0,
216+
Success = 0,
217217
Failure = 1,
218218
InvalidSubscription = 0x7D,
219219
UnsupportedAccess = 0x7E,

matter/tests/data_model/acl_and_dataver.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ fn wc_write_attribute() {
294294
peer,
295295
None,
296296
input0,
297-
&[AttrStatus::new(&ep0_att, IMStatusCode::Sucess, 0)],
297+
&[AttrStatus::new(&ep0_att, IMStatusCode::Success, 0)],
298298
);
299299
assert_eq!(AttrValue::Uint16(val0), read_cluster_id_write_attr(&im, 0));
300300
assert_eq!(
@@ -316,8 +316,8 @@ fn wc_write_attribute() {
316316
None,
317317
input1,
318318
&[
319-
AttrStatus::new(&ep0_att, IMStatusCode::Sucess, 0),
320-
AttrStatus::new(&ep1_att, IMStatusCode::Sucess, 0),
319+
AttrStatus::new(&ep0_att, IMStatusCode::Success, 0),
320+
AttrStatus::new(&ep1_att, IMStatusCode::Success, 0),
321321
],
322322
);
323323
assert_eq!(AttrValue::Uint16(val1), read_cluster_id_write_attr(&im, 0));
@@ -350,7 +350,7 @@ fn exact_write_attribute() {
350350
IMStatusCode::UnsupportedAccess,
351351
0,
352352
)];
353-
let expected_success = &[AttrStatus::new(&ep0_att, IMStatusCode::Sucess, 0)];
353+
let expected_success = &[AttrStatus::new(&ep0_att, IMStatusCode::Success, 0)];
354354

355355
let peer = 98765;
356356
let mut im = ImEngine::new();
@@ -401,7 +401,7 @@ fn exact_write_attribute_noc_cat() {
401401
IMStatusCode::UnsupportedAccess,
402402
0,
403403
)];
404-
let expected_success = &[AttrStatus::new(&ep0_att, IMStatusCode::Sucess, 0)];
404+
let expected_success = &[AttrStatus::new(&ep0_att, IMStatusCode::Success, 0)];
405405

406406
let peer = 98765;
407407
/* CAT in NOC is 1 more, in version, than that in ACL */
@@ -534,8 +534,8 @@ fn write_with_runtime_acl_add() {
534534
&[input0, acl_input, input0],
535535
&[
536536
AttrStatus::new(&ep0_att, IMStatusCode::UnsupportedAccess, 0),
537-
AttrStatus::new(&acl_att, IMStatusCode::Sucess, 0),
538-
AttrStatus::new(&ep0_att, IMStatusCode::Sucess, 0),
537+
AttrStatus::new(&acl_att, IMStatusCode::Success, 0),
538+
AttrStatus::new(&ep0_att, IMStatusCode::Success, 0),
539539
],
540540
);
541541
assert_eq!(AttrValue::Uint16(val0), read_cluster_id_write_attr(&im, 0));
@@ -689,7 +689,7 @@ fn test_write_data_ver() {
689689
peer,
690690
None,
691691
input_correct_dataver,
692-
&[AttrStatus::new(&ep0_attwrite, IMStatusCode::Sucess, 0)],
692+
&[AttrStatus::new(&ep0_attwrite, IMStatusCode::Success, 0)],
693693
);
694694
assert_eq!(AttrValue::Uint16(val0), read_cluster_id_write_attr(&im, 0));
695695

@@ -728,7 +728,7 @@ fn test_write_data_ver() {
728728
peer,
729729
None,
730730
input_correct_dataver,
731-
&[AttrStatus::new(&ep0_attwrite, IMStatusCode::Sucess, 0)],
731+
&[AttrStatus::new(&ep0_attwrite, IMStatusCode::Success, 0)],
732732
);
733733
assert_eq!(AttrValue::Uint16(val1), read_cluster_id_write_attr(&im, 0));
734734

matter/tests/data_model/attribute_lists.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ fn attr_list_ops() {
7373

7474
// Test 1: Add Operation - add val0
7575
let input = &[AttrData::new(None, att_path, EncodeValue::Value(&val0))];
76-
let expected = &[AttrStatus::new(&att_data, IMStatusCode::Sucess, 0)];
76+
let expected = &[AttrStatus::new(&att_data, IMStatusCode::Success, 0)];
7777
let _ = handle_write_reqs(input, expected);
7878

7979
{
@@ -83,7 +83,7 @@ fn attr_list_ops() {
8383

8484
// Test 2: Another Add Operation - add val1
8585
let input = &[AttrData::new(None, att_path, EncodeValue::Value(&val1))];
86-
let expected = &[AttrStatus::new(&att_data, IMStatusCode::Sucess, 0)];
86+
let expected = &[AttrStatus::new(&att_data, IMStatusCode::Success, 0)];
8787
let _ = handle_write_reqs(input, expected);
8888

8989
{
@@ -94,7 +94,7 @@ fn attr_list_ops() {
9494
// Test 3: Edit Operation - edit val1 to val0
9595
att_path.list_index = Some(Nullable::NotNull(1));
9696
let input = &[AttrData::new(None, att_path, EncodeValue::Value(&val0))];
97-
let expected = &[AttrStatus::new(&att_data, IMStatusCode::Sucess, 0)];
97+
let expected = &[AttrStatus::new(&att_data, IMStatusCode::Success, 0)];
9898
let _ = handle_write_reqs(input, expected);
9999

100100
{
@@ -105,7 +105,7 @@ fn attr_list_ops() {
105105
// Test 4: Delete Operation - delete index 0
106106
att_path.list_index = Some(Nullable::NotNull(0));
107107
let input = &[AttrData::new(None, att_path, delete_item)];
108-
let expected = &[AttrStatus::new(&att_data, IMStatusCode::Sucess, 0)];
108+
let expected = &[AttrStatus::new(&att_data, IMStatusCode::Success, 0)];
109109
let _ = handle_write_reqs(input, expected);
110110

111111
{
@@ -121,7 +121,7 @@ fn attr_list_ops() {
121121
att_path,
122122
EncodeValue::Value(&overwrite_val),
123123
)];
124-
let expected = &[AttrStatus::new(&att_data, IMStatusCode::Sucess, 0)];
124+
let expected = &[AttrStatus::new(&att_data, IMStatusCode::Success, 0)];
125125
let _ = handle_write_reqs(input, expected);
126126

127127
{
@@ -132,7 +132,7 @@ fn attr_list_ops() {
132132
// Test 6: Overwrite Operation - delete whole list
133133
att_path.list_index = None;
134134
let input = &[AttrData::new(None, att_path, delete_all)];
135-
let expected = &[AttrStatus::new(&att_data, IMStatusCode::Sucess, 0)];
135+
let expected = &[AttrStatus::new(&att_data, IMStatusCode::Success, 0)];
136136
let _ = handle_write_reqs(input, expected);
137137

138138
{

matter/tests/data_model/attributes.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -371,8 +371,8 @@ fn test_write_success() {
371371
),
372372
];
373373
let expected = &[
374-
AttrStatus::new(&ep0_att, IMStatusCode::Sucess, 0),
375-
AttrStatus::new(&ep1_att, IMStatusCode::Sucess, 0),
374+
AttrStatus::new(&ep0_att, IMStatusCode::Success, 0),
375+
AttrStatus::new(&ep1_att, IMStatusCode::Success, 0),
376376
];
377377

378378
let dm = handle_write_reqs(input, expected);
@@ -428,8 +428,8 @@ fn test_write_wc_endpoint() {
428428
Some(echo_cluster::Attributes::AttWrite as u32),
429429
);
430430
let expected = &[
431-
AttrStatus::new(&ep0_att, IMStatusCode::Sucess, 0),
432-
AttrStatus::new(&ep1_att, IMStatusCode::Sucess, 0),
431+
AttrStatus::new(&ep0_att, IMStatusCode::Success, 0),
432+
AttrStatus::new(&ep1_att, IMStatusCode::Success, 0),
433433
];
434434

435435
let dm = handle_write_reqs(input, expected);

matter/tests/data_model/commands.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ fn test_invoke_cmd_wc_endpoint_only_1_has_cluster() {
151151
let input = &[cmd_data!(target, 1)];
152152
let expected = &[ExpectedInvResp::Status(CmdStatus::new(
153153
expected_path,
154-
IMStatusCode::Sucess,
154+
IMStatusCode::Success,
155155
0,
156156
))];
157157
handle_commands(input, expected);

0 commit comments

Comments
 (0)