summaryrefslogtreecommitdiffstats
path: root/crates/core
diff options
context:
space:
mode:
authorMarcel Müller <m.mueller@ifm.com>2022-02-04 10:17:04 +0100
committerMatthias Beyer <matthias.beyer@ifm.com>2022-03-04 15:03:53 +0100
commitfa35a7b1a027b3712c41010ff979ed1bb56e0cab (patch)
tree0c63e51403070900660228ebeed976b18d4187d0 /crates/core
parent4b13c3fe1ecd294ff41a73f2d10d699588dd8f20 (diff)
Make new methods const
Having them const does two things: - We promise it doesn't do anything except initialize the object - It can be used to initialize const objects Signed-off-by: Marcel Müller <m.mueller@ifm.com> Signed-off-by: Matthias Beyer <matthias.beyer@ifm.com>
Diffstat (limited to 'crates/core')
-rw-r--r--crates/core/tedge_api/src/errors.rs2
-rw-r--r--crates/core/tedge_api/src/plugins.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/crates/core/tedge_api/src/errors.rs b/crates/core/tedge_api/src/errors.rs
index 92b14500..c44f1160 100644
--- a/crates/core/tedge_api/src/errors.rs
+++ b/crates/core/tedge_api/src/errors.rs
@@ -5,7 +5,7 @@ pub struct PluginConfigurationError {
}
impl PluginConfigurationError {
- pub fn new(span: (usize, usize), kind: PluginConfigurationErrorKind) -> Self {
+ pub const fn new(span: (usize, usize), kind: PluginConfigurationErrorKind) -> Self {
Self {
span: Some(span),
kind,
diff --git a/crates/core/tedge_api/src/plugins.rs b/crates/core/tedge_api/src/plugins.rs
index 6bb01b5c..27d660ad 100644
--- a/crates/core/tedge_api/src/plugins.rs
+++ b/crates/core/tedge_api/src/plugins.rs
@@ -14,7 +14,7 @@ pub struct Comms {
}
impl Comms {
- pub fn new(sender: tokio::sync::mpsc::Sender<CoreMessage>) -> Self {
+ pub const fn new(sender: tokio::sync::mpsc::Sender<CoreMessage>) -> Self {
Self { sender }
}